From patchwork Fri Aug 14 18:28:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 7019131 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 07BE7C05AC for ; Fri, 14 Aug 2015 18:31:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 343C120614 for ; Fri, 14 Aug 2015 18:31:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 591E92040F for ; Fri, 14 Aug 2015 18:31:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZQJjF-0002m1-0L; Fri, 14 Aug 2015 18:29:21 +0000 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZQJid-0002O6-7v for linux-arm-kernel@lists.infradead.org; Fri, 14 Aug 2015 18:28:44 +0000 Received: by wicne3 with SMTP id ne3so26096114wic.0 for ; Fri, 14 Aug 2015 11:28:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=rGYq7cswyyH+aCfZW9S04/2RVKMHMHKiFszHQ7sjli8=; b=k08XqFvrLcFPsphkEZF+Hg+6C6MSqzxwEYhZQfptzX8KnWYE+ucwq6S7GzRdkSF4Aw WB94zKcb4BG9RhLZ6og38Qv+xtainRQEo+4KoOzK9Hx7FngsozlgFFFQf/mlnkiExqha QmfuSNwd1Zrq99cATE9xNPinAZIXe5A2I0CmHoHSlYFBzdH0CHquBjTHrqGW6W2VnVm4 VgCwJVHRPKSehtGGpEtXO3cH76XYCmIOjWxU/2aDg5GoSO6t2mO2WbbRiryWv9PWylXM WYdzy3Zkjtv6Ewv2EYQDC4lzGErVyDAkVMambyHbHoD8B9M2lc928AKSBi6B6gxlUkVV Wleg== X-Received: by 10.180.105.165 with SMTP id gn5mr8882641wib.20.1439576901701; Fri, 14 Aug 2015 11:28:21 -0700 (PDT) Received: from rric.localdomain (x5ce0c315.dyn.telefonica.de. [92.224.195.21]) by smtp.gmail.com with ESMTPSA id fn8sm4270672wib.2.2015.08.14.11.28.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Aug 2015 11:28:21 -0700 (PDT) From: Robert Richter To: Marc Zygnier , Thomas Gleixner , Jason Cooper Subject: [PATCH v4 5/5] irqchip, gicv3-its: Workaround for Cavium ThunderX errata 22375, 24313 Date: Fri, 14 Aug 2015 20:28:05 +0200 Message-Id: <1439576885-15621-6-git-send-email-rric@kernel.org> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1439576885-15621-1-git-send-email-rric@kernel.org> References: <1439576885-15621-1-git-send-email-rric@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150814_112843_452016_9F9BD7AC X-CRM114-Status: GOOD ( 13.76 ) X-Spam-Score: -2.4 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robert Richter , Tirumalesh Chalamarla , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Robert Richter 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. v3: * fix erratum to be dependend from iidr Signed-off-by: Robert Richter --- drivers/irqchip/irq-gic-v3-its.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 697421e834ee..30459df2ee2c 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -39,7 +39,8 @@ #include "irq-gic-common.h" #include "irqchip.h" -#define ITS_FLAGS_CMDQ_NEEDS_FLUSHING (1 << 0) +#define ITS_FLAGS_CMDQ_NEEDS_FLUSHING (1ULL << 0) +#define ITS_FLAGS_CAVIUM_THUNDERX (1ULL << 1) #define RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING (1 << 0) @@ -803,9 +804,22 @@ static int its_alloc_tables(struct its_node *its) int i; int psz = SZ_64K; u64 shr = GITS_BASER_InnerShareable; - u64 cache = GITS_BASER_WaWb; - u64 typer = readq_relaxed(its->base + GITS_TYPER); - u32 ids = GITS_TYPER_DEVBITS(typer); + u64 cache; + u64 typer; + u32 ids; + + if (its->flags & ITS_FLAGS_CAVIUM_THUNDERX) { + /* + * erratum 22375: only alloc 8MB table size + * erratum 24313: ignore memory access type + */ + cache = 0; + ids = 0x13; /* 20 bits, 8MB */ + } else { + cache = GITS_BASER_WaWb; + typer = readq_relaxed(its->base + GITS_TYPER); + ids = GITS_TYPER_DEVBITS(typer); + } for (i = 0; i < GITS_BASER_NR_REGS; i++) { u64 val = readq_relaxed(its->base + GITS_BASER + i * 8); @@ -1391,8 +1405,21 @@ static int its_force_quiescent(void __iomem *base) } } +static void its_enable_cavium_thunderx(void *data) +{ + struct its_node *its = data; + + its->flags |= ITS_FLAGS_CAVIUM_THUNDERX; +} + static const struct gic_capabilities its_errata[] = { { + .desc = "ITS: Cavium errata 22375, 24313", + .iidr = 0xa100034c, /* ThunderX pass 1.x */ + .mask = 0xffff0fff, + .init = its_enable_cavium_thunderx, + }, + { } };