[Arm-dev] [PATCH v0 02/20] arm64: gicv3: its: Set correct its table size for ThunderX

Vadim Lomovtsev Vadim.Lomovtsev at caviumnetworks.com
Thu Jul 23 12:37:39 UTC 2015


From: Tirumalesh Chalamarla <tchalamarla at caviumnetworks.com>

Max its table size for ThunderX is 8MB (20 bits, 128 pages).

Currently the controller is detecting 16MB (256 pages). There is a bug
in ITS (erratum 22375) that prevents S/W to set "0xff" (256 of 64KB
pages) as the max table size of device table. This patch avoids
setting page size to the maximum and also saves 8MB unnecessarily
allocated memory.

Signed-off-by: Robert Richter <rrichter at cavium.com>
Signed-off-by: Tirumalesh Chalamarla <tchalamarla at caviumnetworks.com>
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev at caviumnetworks.com>
---
 arch/arm64/Kconfig               | 7 +++++++
 drivers/irqchip/irq-gic-v3-its.c | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 68ef1f1..af502e0 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -243,6 +243,13 @@ config ARCH_THUNDER
 	help
 	  This enables support for Cavium's Thunder Family of SoCs.
 
+config THUNDERX_PASS1_ERRATA_22375
+	bool "Cavium ThunderX erratum 22375"
+	depends on ARCH_THUNDER
+	def_bool ARCH_THUNDER
+	help
+	  Enable workaround for erratum 22375.
+
 config THUNDERX_PASS1_ERRATA_24313
 	bool "Cavium ThunderX erratum 24313"
 	depends on ARCH_THUNDER
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index a46040f..36b664c 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -829,8 +829,12 @@ static int its_alloc_tables(struct its_node *its)
 		 * For other tables, only allocate a single page.
 		 */
 		if (type == GITS_BASER_TYPE_DEVICE) {
+#ifdef CONFIG_THUNDERX_PASS1_ERRATA_22375
+			u32 ids = 0x13;		/* 20 bits, 8MB */
+#else
 			u64 typer = readq_relaxed(its->base + GITS_TYPER);
 			u32 ids = GITS_TYPER_DEVBITS(typer);
+#endif
 
 			/*
 			 * 'order' was initialized earlier to the default page
-- 
2.4.3



More information about the Arm-dev mailing list