.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Support PCI IO workaround |
---|
3 | 4 | * |
---|
4 | 5 | * (C) Copyright 2007-2008 TOSHIBA CORPORATION |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or modify |
---|
7 | | - * it under the terms of the GNU General Public License as published by |
---|
8 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
9 | | - * (at your option) any later version. |
---|
10 | | - * |
---|
11 | | - * This program is distributed in the hope that it will be useful, |
---|
12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | | - * GNU General Public License for more details. |
---|
15 | | - * |
---|
16 | | - * You should have received a copy of the GNU General Public License along |
---|
17 | | - * with this program; if not, write to the Free Software Foundation, Inc., |
---|
18 | | - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
---|
19 | 6 | */ |
---|
20 | 7 | |
---|
21 | 8 | #ifndef _IO_WORKAROUNDS_H |
---|
22 | 9 | #define _IO_WORKAROUNDS_H |
---|
23 | 10 | |
---|
| 11 | +#ifdef CONFIG_PPC_IO_WORKAROUNDS |
---|
24 | 12 | #include <linux/io.h> |
---|
25 | 13 | #include <asm/pci-bridge.h> |
---|
26 | 14 | |
---|
.. | .. |
---|
45 | 33 | #define SPIDER_PCI_DUMMY_READ 0x0810 |
---|
46 | 34 | #define SPIDER_PCI_DUMMY_READ_BASE 0x0814 |
---|
47 | 35 | |
---|
| 36 | +#endif |
---|
| 37 | + |
---|
| 38 | +#if defined(CONFIG_PPC_IO_WORKAROUNDS) && defined(CONFIG_PPC_INDIRECT_MMIO) |
---|
| 39 | +extern bool io_workaround_inited; |
---|
| 40 | + |
---|
| 41 | +static inline bool iowa_is_active(void) |
---|
| 42 | +{ |
---|
| 43 | + return unlikely(io_workaround_inited); |
---|
| 44 | +} |
---|
| 45 | +#else |
---|
| 46 | +static inline bool iowa_is_active(void) |
---|
| 47 | +{ |
---|
| 48 | + return false; |
---|
| 49 | +} |
---|
| 50 | +#endif |
---|
| 51 | + |
---|
| 52 | +void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size, |
---|
| 53 | + pgprot_t prot, void *caller); |
---|
| 54 | + |
---|
48 | 55 | #endif /* _IO_WORKAROUNDS_H */ |
---|