Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Support PCI IO workaround
0004  *
0005  * (C) Copyright 2007-2008 TOSHIBA CORPORATION
0006  */
0007 
0008 #ifndef _IO_WORKAROUNDS_H
0009 #define _IO_WORKAROUNDS_H
0010 
0011 #ifdef CONFIG_PPC_IO_WORKAROUNDS
0012 #include <linux/io.h>
0013 #include <asm/pci-bridge.h>
0014 
0015 /* Bus info */
0016 struct iowa_bus {
0017     struct pci_controller *phb;
0018     struct ppc_pci_io *ops;
0019     void   *private;
0020 };
0021 
0022 void iowa_register_bus(struct pci_controller *, struct ppc_pci_io *,
0023                int (*)(struct iowa_bus *, void *), void *);
0024 struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR);
0025 struct iowa_bus *iowa_pio_find_bus(unsigned long);
0026 
0027 extern struct ppc_pci_io spiderpci_ops;
0028 extern int spiderpci_iowa_init(struct iowa_bus *, void *);
0029 
0030 #define SPIDER_PCI_REG_BASE     0xd000
0031 #define SPIDER_PCI_REG_SIZE     0x1000
0032 #define SPIDER_PCI_VCI_CNTL_STAT    0x0110
0033 #define SPIDER_PCI_DUMMY_READ       0x0810
0034 #define SPIDER_PCI_DUMMY_READ_BASE  0x0814
0035 
0036 #endif
0037 
0038 #if defined(CONFIG_PPC_IO_WORKAROUNDS) && defined(CONFIG_PPC_INDIRECT_MMIO)
0039 extern bool io_workaround_inited;
0040 
0041 static inline bool iowa_is_active(void)
0042 {
0043     return unlikely(io_workaround_inited);
0044 }
0045 #else
0046 static inline bool iowa_is_active(void)
0047 {
0048     return false;
0049 }
0050 #endif
0051 
0052 void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
0053                pgprot_t prot, void *caller);
0054 
0055 #endif /* _IO_WORKAROUNDS_H */