hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/arch/powerpc/kernel/io-workarounds.c
....@@ -1,22 +1,19 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Support PCI IO workaround
34 *
45 * Copyright (C) 2006 Benjamin Herrenschmidt <benh@kernel.crashing.org>
56 * IBM, Corp.
67 * (C) Copyright 2007-2008 TOSHIBA CORPORATION
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129 #undef DEBUG
1310
1411 #include <linux/kernel.h>
1512 #include <linux/sched/mm.h> /* for init_mm */
13
+#include <linux/pgtable.h>
1614
1715 #include <asm/io.h>
1816 #include <asm/machdep.h>
19
-#include <asm/pgtable.h>
2017 #include <asm/ppc-pci.h>
2118 #include <asm/io-workarounds.h>
2219 #include <asm/pte-walk.h>
....@@ -152,11 +149,11 @@
152149 };
153150
154151 #ifdef CONFIG_PPC_INDIRECT_MMIO
155
-static void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
156
- unsigned long flags, void *caller)
152
+void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
153
+ pgprot_t prot, void *caller)
157154 {
158155 struct iowa_bus *bus;
159
- void __iomem *res = __ioremap_caller(addr, size, flags, caller);
156
+ void __iomem *res = __ioremap_caller(addr, size, prot, caller);
160157 int busno;
161158
162159 bus = iowa_pci_find(0, (unsigned long)addr);
....@@ -166,20 +163,17 @@
166163 }
167164 return res;
168165 }
169
-#else /* CONFIG_PPC_INDIRECT_MMIO */
170
-#define iowa_ioremap NULL
171166 #endif /* !CONFIG_PPC_INDIRECT_MMIO */
167
+
168
+bool io_workaround_inited;
172169
173170 /* Enable IO workaround */
174171 static void io_workaround_init(void)
175172 {
176
- static int io_workaround_inited;
177
-
178173 if (io_workaround_inited)
179174 return;
180175 ppc_pci_io = iowa_pci_io;
181
- ppc_md.ioremap = iowa_ioremap;
182
- io_workaround_inited = 1;
176
+ io_workaround_inited = true;
183177 }
184178
185179 /* Register new bus to support workaround */