forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/arch/powerpc/platforms/ps3/spu.c
....@@ -1,21 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * PS3 Platform spu routines.
34 *
45 * Copyright (C) 2006 Sony Computer Entertainment Inc.
56 * Copyright 2006 Sony Corp.
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; version 2 of the License.
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
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
197 */
208
219 #include <linux/kernel.h>
....@@ -196,10 +184,7 @@
196184 * setup_areas - Map the spu regions into the address space.
197185 *
198186 * The current HV requires the spu shadow regs to be mapped with the
199
- * PTE page protection bits set as read-only (PP=3). This implementation
200
- * uses the low level __ioremap() to bypass the page protection settings
201
- * inforced by ioremap_prot() to get the needed PTE bits set for the
202
- * shadow regs.
187
+ * PTE page protection bits set as read-only.
203188 */
204189
205190 static int __init setup_areas(struct spu *spu)
....@@ -207,16 +192,14 @@
207192 struct table {char* name; unsigned long addr; unsigned long size;};
208193 unsigned long shadow_flags = pgprot_val(pgprot_noncached_wc(PAGE_KERNEL_RO));
209194
210
- spu_pdata(spu)->shadow = __ioremap(spu_pdata(spu)->shadow_addr,
211
- sizeof(struct spe_shadow),
212
- shadow_flags);
195
+ spu_pdata(spu)->shadow = ioremap_prot(spu_pdata(spu)->shadow_addr,
196
+ sizeof(struct spe_shadow), shadow_flags);
213197 if (!spu_pdata(spu)->shadow) {
214198 pr_debug("%s:%d: ioremap shadow failed\n", __func__, __LINE__);
215199 goto fail_ioremap;
216200 }
217201
218
- spu->local_store = (__force void *)ioremap_prot(spu->local_store_phys,
219
- LS_SIZE, pgprot_val(pgprot_noncached_wc(__pgprot(0))));
202
+ spu->local_store = (__force void *)ioremap_wc(spu->local_store_phys, LS_SIZE);
220203
221204 if (!spu->local_store) {
222205 pr_debug("%s:%d: ioremap local_store failed\n",
....@@ -465,7 +448,7 @@
465448 ctx->ops->runcntl_stop(ctx);
466449 }
467450
468
-const struct spu_management_ops spu_management_ps3_ops = {
451
+static const struct spu_management_ops spu_management_ps3_ops = {
469452 .enumerate_spus = ps3_enumerate_spus,
470453 .create_spu = ps3_create_spu,
471454 .destroy_spu = ps3_destroy_spu,
....@@ -606,7 +589,7 @@
606589 return 0; /* No support. */
607590 }
608591
609
-const struct spu_priv1_ops spu_priv1_ps3_ops = {
592
+static const struct spu_priv1_ops spu_priv1_ps3_ops = {
610593 .int_mask_and = int_mask_and,
611594 .int_mask_or = int_mask_or,
612595 .int_mask_set = int_mask_set,