hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/arch/powerpc/include/asm/io-workarounds.h
....@@ -1,26 +1,14 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Support PCI IO workaround
34 *
45 * (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.
196 */
207
218 #ifndef _IO_WORKAROUNDS_H
229 #define _IO_WORKAROUNDS_H
2310
11
+#ifdef CONFIG_PPC_IO_WORKAROUNDS
2412 #include <linux/io.h>
2513 #include <asm/pci-bridge.h>
2614
....@@ -45,4 +33,23 @@
4533 #define SPIDER_PCI_DUMMY_READ 0x0810
4634 #define SPIDER_PCI_DUMMY_READ_BASE 0x0814
4735
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
+
4855 #endif /* _IO_WORKAROUNDS_H */