io-workarounds.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Support PCI IO workaround
  4. *
  5. * (C) Copyright 2007-2008 TOSHIBA CORPORATION
  6. */
  7. #ifndef _IO_WORKAROUNDS_H
  8. #define _IO_WORKAROUNDS_H
  9. #ifdef CONFIG_PPC_IO_WORKAROUNDS
  10. #include <linux/io.h>
  11. #include <asm/pci-bridge.h>
  12. /* Bus info */
  13. struct iowa_bus {
  14. struct pci_controller *phb;
  15. struct ppc_pci_io *ops;
  16. void *private;
  17. };
  18. void iowa_register_bus(struct pci_controller *, struct ppc_pci_io *,
  19. int (*)(struct iowa_bus *, void *), void *);
  20. struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR);
  21. struct iowa_bus *iowa_pio_find_bus(unsigned long);
  22. extern struct ppc_pci_io spiderpci_ops;
  23. extern int spiderpci_iowa_init(struct iowa_bus *, void *);
  24. #define SPIDER_PCI_REG_BASE 0xd000
  25. #define SPIDER_PCI_REG_SIZE 0x1000
  26. #define SPIDER_PCI_VCI_CNTL_STAT 0x0110
  27. #define SPIDER_PCI_DUMMY_READ 0x0810
  28. #define SPIDER_PCI_DUMMY_READ_BASE 0x0814
  29. #endif
  30. #if defined(CONFIG_PPC_IO_WORKAROUNDS) && defined(CONFIG_PPC_INDIRECT_MMIO)
  31. extern bool io_workaround_inited;
  32. static inline bool iowa_is_active(void)
  33. {
  34. return unlikely(io_workaround_inited);
  35. }
  36. #else
  37. static inline bool iowa_is_active(void)
  38. {
  39. return false;
  40. }
  41. #endif
  42. void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
  43. pgprot_t prot, void *caller);
  44. #endif /* _IO_WORKAROUNDS_H */