WIP FPC-III support
[linux/fpc-iii.git] / arch / powerpc / include / asm / io-workarounds.h
blob3cce499fbe27a2be122acd8220310517c6b8270d
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Support PCI IO workaround
5 * (C) Copyright 2007-2008 TOSHIBA CORPORATION
6 */
8 #ifndef _IO_WORKAROUNDS_H
9 #define _IO_WORKAROUNDS_H
11 #ifdef CONFIG_PPC_IO_WORKAROUNDS
12 #include <linux/io.h>
13 #include <asm/pci-bridge.h>
15 /* Bus info */
16 struct iowa_bus {
17 struct pci_controller *phb;
18 struct ppc_pci_io *ops;
19 void *private;
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
36 #endif
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);
45 #else
46 static inline bool iowa_is_active(void)
48 return false;
50 #endif
52 void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
53 pgprot_t prot, void *caller);
55 #endif /* _IO_WORKAROUNDS_H */