1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Support PCI IO workaround
5 * (C) Copyright 2007-2008 TOSHIBA CORPORATION
8 #ifndef _IO_WORKAROUNDS_H
9 #define _IO_WORKAROUNDS_H
11 #ifdef CONFIG_PPC_IO_WORKAROUNDS
13 #include <asm/pci-bridge.h>
17 struct pci_controller
*phb
;
18 struct ppc_pci_io
*ops
;
22 void iowa_register_bus(struct pci_controller
*, struct ppc_pci_io
*,
23 int (*)(struct iowa_bus
*, void *), void *);
24 struct iowa_bus
*iowa_mem_find_bus(const PCI_IO_ADDR
);
25 struct iowa_bus
*iowa_pio_find_bus(unsigned long);
27 extern struct ppc_pci_io spiderpci_ops
;
28 extern int spiderpci_iowa_init(struct iowa_bus
*, void *);
30 #define SPIDER_PCI_REG_BASE 0xd000
31 #define SPIDER_PCI_REG_SIZE 0x1000
32 #define SPIDER_PCI_VCI_CNTL_STAT 0x0110
33 #define SPIDER_PCI_DUMMY_READ 0x0810
34 #define SPIDER_PCI_DUMMY_READ_BASE 0x0814
38 #if defined(CONFIG_PPC_IO_WORKAROUNDS) && defined(CONFIG_PPC_INDIRECT_MMIO)
39 extern bool io_workaround_inited
;
41 static inline bool iowa_is_active(void)
43 return unlikely(io_workaround_inited
);
46 static inline bool iowa_is_active(void)
52 void __iomem
*iowa_ioremap(phys_addr_t addr
, unsigned long size
,
53 pgprot_t prot
, void *caller
);
55 #endif /* _IO_WORKAROUNDS_H */