Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp673896imp; Wed, 20 Feb 2019 07:08:02 -0800 (PST) X-Google-Smtp-Source: AHgI3Iayq6SD/anO67ufenxtCKKJtXiOjCOpCePWMzFXEbcl5ytgv3Ubbf2LN1FUkf0iiNZfxZa3 X-Received: by 2002:a63:fa48:: with SMTP id g8mr29625472pgk.203.1550675281966; Wed, 20 Feb 2019 07:08:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550675281; cv=none; d=google.com; s=arc-20160816; b=A0T16H+PeUxW4K8NKyw8lR3zMBihnbwYaahRa9X9hvJTRWOHhaBqoXH0QPLwAngQCz aY/ptQ7/qRdz1Jr3A6btUPVgIW9OKkLviqlI9yK1x/ZcRS3hwDCGMZV3RwcW4ZCCn/tk l6c+PQzvHfPHLq4qSuAvBwTGPc/ZW1AikAYFmphg90W7nYS2fCsvxCqT3GSx5jVgY+q7 diBRMxsa3cPQJS4ZIrlzoFa68M5KmBGgDe0GeZqKrAAWviv3eqtHxf5L0yJbj9XjY9Q5 lOfHEbNXcEVXhz7ogM1kvq757s4UAxZFQraWEMKASNcSI4FSpTF4C6Cn/UEHnOM9z+z3 ZEsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=q0rIqvEUsTQ02ZXHRC1xMzCqoWEXn6BUnQBFHecgTEE=; b=iI9YxjGwaxKekuYFZqzySDakKN4kj7H0gB228QBEmeiQicYslsgJkv77cUHwO/bRmt +vhWC+iq4WSP1AeFcwsy+Eq9zNY4km4SVVbNS0nokHSfVB9jiuEjrTlKD8BnvfN4dHXu C0ZK4vBINjvvz4UQzdy68oxvtOrYxkjD81UMpHWT7ACoD994s9BN99meNrck4NUABBHS vlVmV0IlXu5cRSRB7lABal4d7lAOTGbUx8mxyKgwyHHnCpCkkNYDb/Y3A46Koau/Coqh LvZnjK0hiLalZp6XTdAUM4Tap8YX5CIDS5D8jyIruJUV17pUZEY8mMnInEMIFW31758f uwZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c8si17881594pgl.507.2019.02.20.07.07.40; Wed, 20 Feb 2019 07:08:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727354AbfBTPGG (ORCPT + 99 others); Wed, 20 Feb 2019 10:06:06 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:43120 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbfBTPFh (ORCPT ); Wed, 20 Feb 2019 10:05:37 -0500 Received: from ramsan ([84.194.111.163]) by andre.telenet-ops.be with bizsmtp id f35b1z00S3XaVaC0135bpP; Wed, 20 Feb 2019 16:05:35 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gwTRH-0002IN-LI; Wed, 20 Feb 2019 16:05:35 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gwTRH-0000ew-Jf; Wed, 20 Feb 2019 16:05:35 +0100 From: Geert Uytterhoeven To: Joerg Roedel , Magnus Damm Cc: Laurent Pinchart , iommu@lists.linux-foundation.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 5/7] iommu/ipmmu-vmsa: Move num_utlbs to SoC-specific features Date: Wed, 20 Feb 2019 16:05:29 +0100 Message-Id: <20190220150531.2462-6-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190220150531.2462-1-geert+renesas@glider.be> References: <20190220150531.2462-1-geert+renesas@glider.be> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The maximum number of micro-TLBs per IPMMU instance is not fixed, but depends on the SoC type. Hence move it from struct ipmmu_vmsa_device to struct ipmmu_features, and set up the correct value for both R-Car Gen2 and Gen3 SoCs. Note that currently no code uses this value. Signed-off-by: Geert Uytterhoeven --- drivers/iommu/ipmmu-vmsa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 4e3134a9a52f8d87..0a21e734466eb1bd 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -42,6 +42,7 @@ struct ipmmu_features { bool use_ns_alias_offset; bool has_cache_leaf_nodes; unsigned int number_of_contexts; + unsigned int num_utlbs; bool setup_imbuscr; bool twobit_imttbcr_sl0; bool reserved_context; @@ -53,7 +54,6 @@ struct ipmmu_vmsa_device { struct iommu_device iommu; struct ipmmu_vmsa_device *root; const struct ipmmu_features *features; - unsigned int num_utlbs; unsigned int num_ctx; spinlock_t lock; /* Protects ctx and domains[] */ DECLARE_BITMAP(ctx, IPMMU_CTX_MAX); @@ -972,6 +972,7 @@ static const struct ipmmu_features ipmmu_features_default = { .use_ns_alias_offset = true, .has_cache_leaf_nodes = false, .number_of_contexts = 1, /* software only tested with one context */ + .num_utlbs = 32, .setup_imbuscr = true, .twobit_imttbcr_sl0 = false, .reserved_context = false, @@ -981,6 +982,7 @@ static const struct ipmmu_features ipmmu_features_rcar_gen3 = { .use_ns_alias_offset = false, .has_cache_leaf_nodes = true, .number_of_contexts = 8, + .num_utlbs = 48, .setup_imbuscr = false, .twobit_imttbcr_sl0 = true, .reserved_context = true, @@ -1033,7 +1035,6 @@ static int ipmmu_probe(struct platform_device *pdev) } mmu->dev = &pdev->dev; - mmu->num_utlbs = 48; spin_lock_init(&mmu->lock); bitmap_zero(mmu->ctx, IPMMU_CTX_MAX); mmu->features = of_device_get_match_data(&pdev->dev); -- 2.17.1