From patchwork Mon Jun 19 09:14:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 9795577 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3DB9D600C5 for ; Mon, 19 Jun 2017 09:19:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EC4727C05 for ; Mon, 19 Jun 2017 09:19:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33236283C0; Mon, 19 Jun 2017 09:19:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9D4E27C05 for ; Mon, 19 Jun 2017 09:19:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753699AbdFSJTB (ORCPT ); Mon, 19 Jun 2017 05:19:01 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:34218 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753839AbdFSJSr (ORCPT ); Mon, 19 Jun 2017 05:18:47 -0400 Received: by mail-pg0-f65.google.com with SMTP id j186so14608777pge.1; Mon, 19 Jun 2017 02:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=lij9WtDSzAXvJCdSkfVHhVMEOghJ3VhZV4BBr3T2zNY=; b=KDqAM0uzjXIcguI9+3dg5g8UF7Z/5noHYMLmm6rwQKOQa5dSsjHNen5/FuCKlFBV2T wTt6IyNzO9HzUaUtizhdlYzZ3s/cfkv1IDG7ytd+KD5ONTvRMLKjMtrn0mdlM4RAU5u8 CD3l+mvxc7Sc68Ru8Ta2Y74GK5AuQzmiOJMvEhzZTymwMlfrc/rG9ADcsY1TF04xd8/8 9APf1pyflv4IjLPv5uYW/PeMddyFHKb4MX4ynwg/ni+cqaJCejkpPAsOzK72ix1/olap 3r3UVjLUzYQCa+b3wfQQXblFc7i8yCRtIOm4/JKcxyHL5DWeM1dC5+sx2l93mWp/XZq6 Lsxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:date:message-id:in-reply-to :references:subject; bh=lij9WtDSzAXvJCdSkfVHhVMEOghJ3VhZV4BBr3T2zNY=; b=D+k225Mff3MPTCpueVZ026aLJKzBcT5ooUeK6+Dgs+pC+OHPPya63i9UGAi4QYbywI YFLg/us3fbRvQ9/ztDMFmy1mkhJeJcduIubUaoht+g/9YNPUV1uZ6H2oqzFoHsDoI2gb bkfLNpCjxdXkFxD8xwaX5ZChk4f7I9xCcR3aWm3bG4ldnIyAxXqP+IYDnxc5aYka8XO5 5YNL/i/B1FsVi3x/MHGc0nSgLKMqtkGfvqn58kjoRsyixiWbSlBMKkbMh2HIXLZ0PWBL V4ehvHW2hE6UFUXRiaMu7ylS473TYgLsRnsQU1hnUc6aD2eC91iZ78wsFZdMN+TZVuTC fXDQ== X-Gm-Message-State: AKS2vOwcfarGziZpb4S7OY/6SSzYtLt7Sz2O0H32MYKTCURpCMl2jHrT SVQ/aqeBDjTi7g== X-Received: by 10.98.142.17 with SMTP id k17mr24359245pfe.139.1497863926591; Mon, 19 Jun 2017 02:18:46 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by smtp.gmail.com with ESMTPSA id e18sm21305368pfk.118.2017.06.19.02.18.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jun 2017 02:18:45 -0700 (PDT) From: Magnus Damm To: joro@8bytes.org Cc: laurent.pinchart+renesas@ideasonboard.com, geert+renesas@glider.be, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, iommu@lists.linux-foundation.org, horms+renesas@verge.net.au, Magnus Damm , robin.murphy@arm.com, m.szyprowski@samsung.com Date: Mon, 19 Jun 2017 18:14:58 +0900 Message-Id: <149786369896.14868.6954404224843797586.sendpatchset@little-apple> In-Reply-To: <149786362527.14868.2143461703972595839.sendpatchset@little-apple> References: <149786362527.14868.2143461703972595839.sendpatchset@little-apple> Subject: [PATCH v4 07/09] iommu/ipmmu-vmsa: Make IMBUSCTR setup optional Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Introduce a feature to allow opt-out of setting up IMBUSCR. The default case is unchanged. Signed-off-by: Magnus Damm --- Changes since V3: - None Changes since V2: - None Changes since V1: - Updated the commit message - Reworked patch to coexist with the multi context feature drivers/iommu/ipmmu-vmsa.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- 0025/drivers/iommu/ipmmu-vmsa.c +++ work/drivers/iommu/ipmmu-vmsa.c 2017-06-19 14:07:06.850607110 +0900 @@ -39,6 +39,7 @@ struct ipmmu_features { bool use_ns_alias_offset; bool has_cache_leaf_nodes; unsigned int number_of_contexts; + bool setup_imbuscr; }; struct ipmmu_vmsa_device { @@ -453,9 +454,10 @@ static int ipmmu_domain_init_context(str domain->cfg.arm_lpae_s1_cfg.mair[0]); /* IMBUSCR */ - ipmmu_ctx_write_root(domain, IMBUSCR, - ipmmu_ctx_read_root(domain, IMBUSCR) & - ~(IMBUSCR_DVM | IMBUSCR_BUSSEL_MASK)); + if (domain->root->features->setup_imbuscr) + ipmmu_ctx_write_root(domain, IMBUSCR, + ipmmu_ctx_read_root(domain, IMBUSCR) & + ~(IMBUSCR_DVM | IMBUSCR_BUSSEL_MASK)); /* * IMSTR @@ -986,6 +988,7 @@ static const struct ipmmu_features ipmmu .use_ns_alias_offset = true, .has_cache_leaf_nodes = false, .number_of_contexts = 1, /* software only tested with one context */ + .setup_imbuscr = true, }; static const struct of_device_id ipmmu_of_ids[] = {