| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * arch/arm/mm/cache-l2x0.c - L210/L220/L310 cache controller support |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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 |
|---|
| 18 | 6 | */ |
|---|
| 19 | 7 | #include <linux/cpu.h> |
|---|
| 20 | 8 | #include <linux/err.h> |
|---|
| .. | .. |
|---|
| 30 | 18 | #include <asm/cp15.h> |
|---|
| 31 | 19 | #include <asm/cputype.h> |
|---|
| 32 | 20 | #include <asm/hardware/cache-l2x0.h> |
|---|
| 21 | +#include <asm/hardware/cache-aurora-l2.h> |
|---|
| 33 | 22 | #include "cache-tauros3.h" |
|---|
| 34 | | -#include "cache-aurora-l2.h" |
|---|
| 35 | 23 | |
|---|
| 36 | 24 | struct l2c_init_data { |
|---|
| 37 | 25 | const char *type; |
|---|
| .. | .. |
|---|
| 1372 | 1360 | * since cache range operations stall the CPU pipeline |
|---|
| 1373 | 1361 | * until completion. |
|---|
| 1374 | 1362 | */ |
|---|
| 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; |
|---|
| 1377 | 1365 | |
|---|
| 1378 | 1366 | /* |
|---|
| 1379 | 1367 | * Cache range operations can't straddle a page boundary. |
|---|
| .. | .. |
|---|
| 1513 | 1501 | mask |= AURORA_ACR_FORCE_WRITE_POLICY_MASK; |
|---|
| 1514 | 1502 | } |
|---|
| 1515 | 1503 | |
|---|
| 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 | + |
|---|
| 1516 | 1516 | *aux_val &= ~mask; |
|---|
| 1517 | 1517 | *aux_val |= val; |
|---|
| 1518 | 1518 | *aux_mask &= ~mask; |
|---|