|
39 | 39 |
|
40 | 40 | #include "irq-gic-common.h"
|
41 | 41 |
|
42 |
| -#define ITS_FLAGS_CMDQ_NEEDS_FLUSHING (1 << 0) |
| 42 | +#define ITS_FLAGS_CMDQ_NEEDS_FLUSHING (1ULL << 0) |
| 43 | +#define ITS_FLAGS_WORKAROUND_CAVIUM_22375 (1ULL << 1) |
43 | 44 |
|
44 | 45 | #define RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING (1 << 0)
|
45 | 46 |
|
@@ -816,9 +817,22 @@ static int its_alloc_tables(const char *node_name, struct its_node *its)
|
816 | 817 | int i;
|
817 | 818 | int psz = SZ_64K;
|
818 | 819 | u64 shr = GITS_BASER_InnerShareable;
|
819 |
| - u64 cache = GITS_BASER_WaWb; |
820 |
| - u64 typer = readq_relaxed(its->base + GITS_TYPER); |
821 |
| - u32 ids = GITS_TYPER_DEVBITS(typer); |
| 820 | + u64 cache; |
| 821 | + u64 typer; |
| 822 | + u32 ids; |
| 823 | + |
| 824 | + if (its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_22375) { |
| 825 | + /* |
| 826 | + * erratum 22375: only alloc 8MB table size |
| 827 | + * erratum 24313: ignore memory access type |
| 828 | + */ |
| 829 | + cache = 0; |
| 830 | + ids = 0x14; /* 20 bits, 8MB */ |
| 831 | + } else { |
| 832 | + cache = GITS_BASER_WaWb; |
| 833 | + typer = readq_relaxed(its->base + GITS_TYPER); |
| 834 | + ids = GITS_TYPER_DEVBITS(typer); |
| 835 | + } |
822 | 836 |
|
823 | 837 | for (i = 0; i < GITS_BASER_NR_REGS; i++) {
|
824 | 838 | u64 val = readq_relaxed(its->base + GITS_BASER + i * 8);
|
@@ -1377,7 +1391,22 @@ static int its_force_quiescent(void __iomem *base)
|
1377 | 1391 | }
|
1378 | 1392 | }
|
1379 | 1393 |
|
| 1394 | +static void __maybe_unused its_enable_quirk_cavium_22375(void *data) |
| 1395 | +{ |
| 1396 | + struct its_node *its = data; |
| 1397 | + |
| 1398 | + its->flags |= ITS_FLAGS_WORKAROUND_CAVIUM_22375; |
| 1399 | +} |
| 1400 | + |
1380 | 1401 | static const struct gic_quirk its_quirks[] = {
|
| 1402 | +#ifdef CONFIG_CAVIUM_ERRATUM_22375 |
| 1403 | + { |
| 1404 | + .desc = "ITS: Cavium errata 22375, 24313", |
| 1405 | + .iidr = 0xa100034c, /* ThunderX pass 1.x */ |
| 1406 | + .mask = 0xffff0fff, |
| 1407 | + .init = its_enable_quirk_cavium_22375, |
| 1408 | + }, |
| 1409 | +#endif |
1381 | 1410 | {
|
1382 | 1411 | }
|
1383 | 1412 | };
|
|
0 commit comments