Skip to content

Commit 9410097

Browse files
Robert RichterKAGA-KOKO
authored andcommitted
irqchip/gicv3-its: Workaround for Cavium ThunderX errata 22375, 24313
This implements two gicv3-its errata workarounds for ThunderX. Both with small impact affecting only ITS table allocation. erratum 22375: only alloc 8MB table size erratum 24313: ignore memory access type The fixes are in ITS initialization and basically ignore memory access type and table size provided by the TYPER and BASER registers. Signed-off-by: Ganapatrao Kulkarni <gkulkarni@caviumnetworks.com> Signed-off-by: Robert Richter <rrichter@cavium.com> Reviewed-by: Marc Zygnier <marc.zyngier@arm.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Cc: Tirumalesh Chalamarla <tchalamarla@cavium.com> Cc: linux-arm-kernel@lists.infradead.org Cc: Jason Cooper <jason@lakedaemon.net> Cc: Will Deacon <will.deacon@arm.com> Link: http://lkml.kernel.org/r/1442869119-1814-6-git-send-email-rric@kernel.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 67510cc commit 9410097

File tree

2 files changed

+50
-4
lines changed

2 files changed

+50
-4
lines changed

arch/arm64/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,23 @@ config ARM64_ERRATUM_843419
348348

349349
If unsure, say Y.
350350

351+
config CAVIUM_ERRATUM_22375
352+
bool "Cavium erratum 22375, 24313"
353+
default y
354+
help
355+
Enable workaround for erratum 22375, 24313.
356+
357+
This implements two gicv3-its errata workarounds for ThunderX. Both
358+
with small impact affecting only ITS table allocation.
359+
360+
erratum 22375: only alloc 8MB table size
361+
erratum 24313: ignore memory access type
362+
363+
The fixes are in ITS initialization and basically ignore memory access
364+
type and table size provided by the TYPER and BASER registers.
365+
366+
If unsure, say Y.
367+
351368
config CAVIUM_ERRATUM_23154
352369
bool "Cavium erratum 23154: Access to ICC_IAR1_EL1 is not sync'ed"
353370
default y

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939

4040
#include "irq-gic-common.h"
4141

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)
4344

4445
#define RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING (1 << 0)
4546

@@ -816,9 +817,22 @@ static int its_alloc_tables(const char *node_name, struct its_node *its)
816817
int i;
817818
int psz = SZ_64K;
818819
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+
}
822836

823837
for (i = 0; i < GITS_BASER_NR_REGS; i++) {
824838
u64 val = readq_relaxed(its->base + GITS_BASER + i * 8);
@@ -1377,7 +1391,22 @@ static int its_force_quiescent(void __iomem *base)
13771391
}
13781392
}
13791393

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+
13801401
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
13811410
{
13821411
}
13831412
};

0 commit comments

Comments
 (0)