From patchwork Mon Jun 19 11:04:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 9795793 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 0DB226020B for ; Mon, 19 Jun 2017 11:08:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00F4627813 for ; Mon, 19 Jun 2017 11:08:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E985A27F8F; Mon, 19 Jun 2017 11:08:38 +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=ham 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 0F4F627813 for ; Mon, 19 Jun 2017 11:08:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753894AbdFSLIh (ORCPT ); Mon, 19 Jun 2017 07:08:37 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:34518 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753580AbdFSLIf (ORCPT ); Mon, 19 Jun 2017 07:08:35 -0400 Received: by mail-pg0-f66.google.com with SMTP id j186so15051084pge.1; Mon, 19 Jun 2017 04:08:35 -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=zYoXhQ/8JM1tV6HlltGAdi6PnL3IgsRMZ39qZUQRRAg=; b=bGn9aFduGXTbyaWpEbPBGp6XGPGxmJsXD62PTLO1YecTKS/Me9/rmpmM1sTYcV6R2F b9QMH9GwIyUqEx2soGscpTbPJ+lJVKRGTopqlnkWvVwZvEo7eVfHRgysjDT7pVaCBoOl zpYiZb+wsE40KTuTZlObrThiQwedvRJfrP/Iao/ujxPtPKF5iQK5zWdZmNQcT/cyOHBb T5G3lUP6BNYSYWpVkZrTHY66TwlNBRMO6mLbCJruqf9CpVpY0fYvVQItQS2QvRbwzSho UMvk/C2SlM2z9bMNvVFk4XEPa92enqt5I/afQf3TMnG06dDwa6J5eBRja+nQGLLfYwpx 65pg== 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=zYoXhQ/8JM1tV6HlltGAdi6PnL3IgsRMZ39qZUQRRAg=; b=pm2kcF7mh8K3P99/95JL0fIoJZVOSe47fHQWSfwVWDeySCN5GQ7fKwZlErZfJeq1uj oOE1x1nUDSLDXNRA5tmStsq1POwQsO0CTRrjGJcMQFg5aFi1DGfRWwEb05lw66CoiAR3 hfvcQYaNyRjtuSF/588DT5qin1Y61gl5W/oothL4aisX0niA6dSfk80dkYmExSxsZSSY +rouY49wP+NiZKaxWTMqCbnreRl1hJoSsw2NWqB9vVHReQwr+pU0UeRLGAnh9kZLTwLO JH5FUmvt2QhEMc9A+uR/NAxhimEGwVbmVVPWvkd3Bl8/DeekIZGtPUPyDYs0Fp7Jea2s 9IsQ== X-Gm-Message-State: AKS2vOzMViCgz7yg6IPscDd5KAIoMqE44NziP280YoWMxVKVyM/dQDU6 26MuNomDoqM9+Q== X-Received: by 10.84.218.5 with SMTP id q5mr6774817pli.295.1497870515302; Mon, 19 Jun 2017 04:08:35 -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 l22sm20263518pfb.55.2017.06.19.04.08.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jun 2017 04:08:33 -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 20:04:47 +0900 Message-Id: <149787028779.32495.1462495100153656335.sendpatchset@little-apple> In-Reply-To: <149787025647.32495.1584960416060100962.sendpatchset@little-apple> References: <149787025647.32495.1584960416060100962.sendpatchset@little-apple> Subject: [PATCH v4 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code 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 Support the r8a7796 IPMMU by sharing feature flags between r8a7795 and r8a7796. Also update IOMMU_OF_DECLARE to hook up the updated compat string. Signed-off-by: Magnus Damm Reviewed-by: Geert Uytterhoeven --- Changes since V3: - Added Reviewed-by from Geert - thanks! Changes since V2: - Updated to include white list suppport Changes since V1: - None drivers/iommu/ipmmu-vmsa.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) --- 0016/drivers/iommu/ipmmu-vmsa.c +++ work/drivers/iommu/ipmmu-vmsa.c 2017-06-19 19:48:27.430607110 +0900 @@ -755,8 +755,9 @@ static bool ipmmu_slave_whitelist(struct return false; } -static const struct soc_device_attribute soc_r8a7795[] = { +static const struct soc_device_attribute soc_rcar_gen3[] = { { .soc_id = "r8a7795", }, + { .soc_id = "r8a7796", }, { /* sentinel */ } }; @@ -772,7 +773,7 @@ static int ipmmu_of_xlate(struct device } /* For R-Car Gen3 use a white list to opt-in slave devices */ - if (soc_device_match(soc_r8a7795) && !ipmmu_slave_whitelist(dev)) + if (soc_device_match(soc_rcar_gen3) && !ipmmu_slave_whitelist(dev)) return -ENODEV; iommu_fwspec_add_ids(dev, spec->args, 1); @@ -1034,7 +1035,7 @@ static const struct ipmmu_features ipmmu .twobit_imttbcr_sl0 = false, }; -static const struct ipmmu_features ipmmu_features_r8a7795 = { +static const struct ipmmu_features ipmmu_features_rcar_gen3 = { .use_ns_alias_offset = false, .has_cache_leaf_nodes = true, .number_of_contexts = 8, @@ -1048,7 +1049,10 @@ static const struct of_device_id ipmmu_o .data = &ipmmu_features_default, }, { .compatible = "renesas,ipmmu-r8a7795", - .data = &ipmmu_features_r8a7795, + .data = &ipmmu_features_rcar_gen3, + }, { + .compatible = "renesas,ipmmu-r8a7796", + .data = &ipmmu_features_rcar_gen3, }, { /* Terminator */ }, @@ -1229,6 +1233,8 @@ IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r ipmmu_vmsa_iommu_of_setup); IOMMU_OF_DECLARE(ipmmu_r8a7795_iommu_of, "renesas,ipmmu-r8a7795", ipmmu_vmsa_iommu_of_setup); +IOMMU_OF_DECLARE(ipmmu_r8a7796_iommu_of, "renesas,ipmmu-r8a7796", + ipmmu_vmsa_iommu_of_setup); #endif MODULE_DESCRIPTION("IOMMU API for Renesas VMSA-compatible IPMMU");