From patchwork Tue Jun 30 14:14:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 6696521 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 0AB4FC05AD for ; Tue, 30 Jun 2015 14:17:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 37B022049E for ; Tue, 30 Jun 2015 14:17:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3022A2061F for ; Tue, 30 Jun 2015 14:17:13 +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 1Z9wJr-0003q2-TQ; Tue, 30 Jun 2015 14:15:27 +0000 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z9wJC-0002Fz-DE for linux-arm-kernel@lists.infradead.org; Tue, 30 Jun 2015 14:14:47 +0000 Received: by wiar9 with SMTP id r9so37942557wia.1 for ; Tue, 30 Jun 2015 07:14:24 -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=rvSTYN53u7q58UdzxD09GLRg9HEfu5CssEKlbX0YbCw=; b=yMNk3KpDyFQ1JbNIwGyOv88r2wK+MXo0IqH0ApbIqlK7RMyBG0FVbvRQNd4RBZRuBL CnB5OzQOY3n/Cgi9fMDHq0H7wraLPs+z0MP3iBd25cuyG5RdXTWTq65mU5QTLmV3WjCc xXrYfG9BhZD+pmyHVWtX5KbUk4jurAib32ezuiqFpRzDmdh4x5w2nOBkPJe6mBitH954 BYXU54A7tOs9hhUP2f2m3wTGASzlJGtRpnqBMzpyvVG+iyCg+Rq5BTuGKIFqszDsw66B A3xAF9TIbLkR7LfnSx9kkTlPRomV7NJbUkSZLDY886YrxlVwa2+hdY80l+Ty1OaRx6pA iUWg== X-Received: by 10.180.75.132 with SMTP id c4mr23285136wiw.20.1435673664183; Tue, 30 Jun 2015 07:14:24 -0700 (PDT) Received: from rric.localhost (f053084022.adsl.alicedsl.de. [78.53.84.22]) by mx.google.com with ESMTPSA id ym2sm69250192wjc.44.2015.06.30.07.14.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jun 2015 07:14:23 -0700 (PDT) From: Robert Richter To: Marc Zygnier , Thomas Gleixner , Jason Cooper Subject: [PATCH 4/4] irqchip, gicv3-its: Implement Cavium ThunderX errata 22375, 24313 Date: Tue, 30 Jun 2015 16:14:03 +0200 Message-Id: <1435673643-31676-5-git-send-email-rric@kernel.org> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1435673643-31676-1-git-send-email-rric@kernel.org> References: <1435673643-31676-1-git-send-email-rric@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150630_071446_606287_579CFC33 X-CRM114-Status: GOOD ( 14.69 ) X-Spam-Score: -2.4 (--) Cc: Robert Richter , Tirumalesh Chalamarla , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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=-4.7 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 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: 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 de2fc82bba83..049ef761fbc3 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); @@ -1382,8 +1396,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", + .id = 0xa100034c, /* ThunderX pass 1.x */ + .mask = 0xffff0fff, + .init = its_enable_cavium_thunderx, + }, + { } };