hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/arch/arm/mm/cache-l2x0.c
....@@ -1,20 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * arch/arm/mm/cache-l2x0.c - L210/L220/L310 cache controller support
34 *
45 * Copyright (C) 2007 ARM Limited
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 version 2 as
8
- * published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
186 */
197 #include <linux/cpu.h>
208 #include <linux/err.h>
....@@ -30,8 +18,8 @@
3018 #include <asm/cp15.h>
3119 #include <asm/cputype.h>
3220 #include <asm/hardware/cache-l2x0.h>
21
+#include <asm/hardware/cache-aurora-l2.h>
3322 #include "cache-tauros3.h"
34
-#include "cache-aurora-l2.h"
3523
3624 struct l2c_init_data {
3725 const char *type;
....@@ -1372,8 +1360,8 @@
13721360 * since cache range operations stall the CPU pipeline
13731361 * until completion.
13741362 */
1375
- if (end > start + MAX_RANGE_SIZE)
1376
- end = start + MAX_RANGE_SIZE;
1363
+ if (end > start + AURORA_MAX_RANGE_SIZE)
1364
+ end = start + AURORA_MAX_RANGE_SIZE;
13771365
13781366 /*
13791367 * Cache range operations can't straddle a page boundary.
....@@ -1513,6 +1501,18 @@
15131501 mask |= AURORA_ACR_FORCE_WRITE_POLICY_MASK;
15141502 }
15151503
1504
+ if (of_property_read_bool(np, "marvell,ecc-enable")) {
1505
+ mask |= AURORA_ACR_ECC_EN;
1506
+ val |= AURORA_ACR_ECC_EN;
1507
+ }
1508
+
1509
+ if (of_property_read_bool(np, "arm,parity-enable")) {
1510
+ mask |= AURORA_ACR_PARITY_EN;
1511
+ val |= AURORA_ACR_PARITY_EN;
1512
+ } else if (of_property_read_bool(np, "arm,parity-disable")) {
1513
+ mask |= AURORA_ACR_PARITY_EN;
1514
+ }
1515
+
15161516 *aux_val &= ~mask;
15171517 *aux_val |= val;
15181518 *aux_mask &= ~mask;