Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3147808ybi; Mon, 10 Jun 2019 05:21:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+XDNE4+T9Rbw/+JZaQ7bpYeNsVnwtJcrasmfHgOhAuNCCH3QJq3WHrXabVKl3lHqWbAGX X-Received: by 2002:a17:902:2ae6:: with SMTP id j93mr72217980plb.130.1560169311689; Mon, 10 Jun 2019 05:21:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560169311; cv=none; d=google.com; s=arc-20160816; b=jAS/WpMNbESEqj8THlSdJZCiJLK5sZjMCP+uLfVdDSzpkBmywlFKzwyjUL2T9tqoHk Rbz5PGKz3CCjRoM5JshGkFtj1YizsM8njHKEBnmBjnYxcP+ZvXlcQ+dxOX1vKfd9SGJ3 0lFia0NB/XC56Dk6cHch8dOyXL03tKexQQXULDIFGcKHV/zNARo6wW3SApLHbkSSo22a Kv3RWq+3yv88g51oJDWbt16qiWKkPlQxbZH3sJDBWOAPX3oyPOOTkYt+Z1Qbj2LdusRi e00JSnf4EjcIoxP2SuRICpfjpxJw6XJ3mu8WOCPVLvp3md1KIiACthDbaguamkvE2zCq JX1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=O0XvQc1IaK1BZuFNHBDYWvfgugpEbo7fKpvHUVu/kao=; b=WLMYLz1eNFmS6kFVdeP5Mbj9OvWBK3lsN9BgHdaFicxVol/UElSDHSv3lvKxWKc9Qj YlWE946hsne+fdCTp0OdXDx0QGyVQOIzpnkmde3YTfbO/1jlHqpt484CGZCNG2CPm0bm cHqXl0L+I5liXqtTxITg2HpZwA1pXxp+FdzXVBxYSsWcP0nG7XZ6adoF1g95OMV2bbcV 1CUytLNMTZOD7Jj2pAhNHaZX7Lz9ejnsu8x3yNp0vnXeLRquM3ZxES9mlNXn6AGWFgNg AiGFOrt0afs7LDefUSntTF71yzm6wBgC7Gg3XJDQl75zR8YCN1O0jUPvAstFlekiTGqV Tiyg== 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 c22si2084827plz.148.2019.06.10.05.21.36; Mon, 10 Jun 2019 05:21:51 -0700 (PDT) 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 S2389961AbfFJMUo (ORCPT + 99 others); Mon, 10 Jun 2019 08:20:44 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:16031 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2388952AbfFJMUo (ORCPT ); Mon, 10 Jun 2019 08:20:44 -0400 X-UUID: e16c8ad5fe4d45178609e9c47a0a41af-20190610 X-UUID: e16c8ad5fe4d45178609e9c47a0a41af-20190610 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 686720749; Mon, 10 Jun 2019 20:20:38 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 10 Jun 2019 20:20:37 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 10 Jun 2019 20:20:35 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Robin Murphy , Rob Herring CC: Evan Green , Tomasz Figa , Will Deacon , , , , , , , , , , Nicolas Boichat , , Matthias Kaehlcke Subject: [PATCH v7 11/21] iommu/mediatek: Move vld_pa_rng into plat_data Date: Mon, 10 Jun 2019 20:17:50 +0800 Message-ID: <1560169080-27134-12-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1560169080-27134-1-git-send-email-yong.wu@mediatek.com> References: <1560169080-27134-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Both mt8173 and mt8183 don't have this vld_pa_rng(valid physical address range) register while mt2712 have. Move it into the plat_data. Signed-off-by: Yong Wu Reviewed-by: Evan Green --- drivers/iommu/mtk_iommu.c | 3 ++- drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 8ac7034..a535dcd 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -547,7 +547,7 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data) upper_32_bits(data->protect_base); writel_relaxed(regval, data->base + REG_MMU_IVRP_PADDR); - if (data->enable_4GB && data->plat_data->m4u_plat != M4U_MT8173) { + if (data->enable_4GB && data->plat_data->has_vld_pa_rng) { /* * If 4GB mode is enabled, the validate PA range is from * 0x1_0000_0000 to 0x1_ffff_ffff. here record bit[32:30]. @@ -744,6 +744,7 @@ static int __maybe_unused mtk_iommu_resume(struct device *dev) .m4u_plat = M4U_MT2712, .has_4gb_mode = true, .has_bclk = true, + .has_vld_pa_rng = true, .larbid_remap = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, }; diff --git a/drivers/iommu/mtk_iommu.h b/drivers/iommu/mtk_iommu.h index 55d73c1..e5c9dde 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -47,6 +47,7 @@ struct mtk_iommu_plat_data { /* HW will use the EMI clock if there isn't the "bclk". */ bool has_bclk; bool reset_axi; + bool has_vld_pa_rng; unsigned char larbid_remap[MTK_LARB_NR_MAX]; }; -- 1.9.1