Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11478783imu; Mon, 31 Dec 2018 23:53:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN4jaax77sTgSCvfYVnua3nIjiWqJ22EAWFd4NdID9gJl0AUhcYN2SqHP1Lhk2FEYLAzT42/ X-Received: by 2002:a63:1560:: with SMTP id 32mr9741930pgv.383.1546329208839; Mon, 31 Dec 2018 23:53:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546329208; cv=none; d=google.com; s=arc-20160816; b=Rvd4N1e+f0hPrpLLlgDr6Wb3q3qCYD9ZHh9iRH44txkaq2zTNDdH1Tek+3KaRY5CoC TuXGhOxgLDwoOpre5tSYRyd2ncWdKBFla94rYObHEMJXSDxG/izqhx1DYbBSYLWA8eTb qBPXx86hZdSlEDRtKRPZ22WuNh3alOHNnpZFnPW68SJHtT/gy8gTgbeCcIniLD/e+fzW dVvb7lZTWQnfmeLokRU9ZZb35QgXJlwL4/xCL+IE6q6aOsmZmdvqYUUzXDF3wtxe7hiL Oe4hI5i67BH30UxKbVQYWmokSFX+ieJXBWSeQoHIjV9t0YekoQOE61MXdmgLpUCyHZuA g0rQ== 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=V0W5yczQr2pItnSZeaKvrvSIGy3/Ua70GV4F0p7QTxg=; b=OLr5CW9jlVz5pWSFfi44xMq3JmVwHg2C1MLs2uH2Eaz6eemM6egvlL484N+cEdu7zz On/Nsm2ThCEYYMVzdFO9+OqkC7ZFrRXmwt0BOmRwTfpKS/hCQxcE6CI7VwK6TxgBlRir Z2KKsXcydK+X7vkctjYS2m7dwYrrg8UsMOVAOOTsu/pfIYF0OqrzvaSGNdBL7ZpjqNVv H18ng2cv4ZGRtp1GsTP9QIDo1Ct4l9lqf5hTrjpnfOE7G97CyfVEyR3HC7v8NiOYsuZ2 Y+mFS3cx0R3vINNz8sVbbAVoW7CHi3APfZEljFa6NiSnJyGFAj4GU6HWIOJRyIYESwJz izZA== 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 c7si47450958pgg.339.2018.12.31.23.52.58; Mon, 31 Dec 2018 23:53:28 -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 S1728325AbfAAD6i (ORCPT + 99 others); Mon, 31 Dec 2018 22:58:38 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:36287 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728271AbfAAD6h (ORCPT ); Mon, 31 Dec 2018 22:58:37 -0500 X-UUID: 753928830f08448791800aacbb10f7c4-20190101 X-UUID: 753928830f08448791800aacbb10f7c4-20190101 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 620227640; Tue, 01 Jan 2019 11:58:33 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 1 Jan 2019 11:58:31 +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; Tue, 1 Jan 2019 11:58:31 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Robin Murphy , Rob Herring CC: Tomasz Figa , Will Deacon , , , , , , , , , , , Nicolas Boichat Subject: [PATCH v5 11/20] iommu/mediatek: Move vld_pa_rng into plat_data Date: Tue, 1 Jan 2019 11:55:43 +0800 Message-ID: <1546314952-15990-12-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1546314952-15990-1-git-send-email-yong.wu@mediatek.com> References: <1546314952-15990-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 07A01F6DA80F4BFA1A72118DC3BCB47EFF21EAA9EDFC43405C8924E4A72E3EC92000:8 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 --- 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 8d8ab21..2913ddb 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -548,7 +548,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->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]. @@ -741,6 +741,7 @@ static int __maybe_unused mtk_iommu_resume(struct device *dev) .m4u_plat = M4U_MT2712, .has_4gb_mode = true, .has_bclk = true, + .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 b46aeaa..a8c5d1e 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -48,6 +48,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 vld_pa_rng; unsigned char larbid_remap[MTK_LARB_NR_MAX]; }; -- 1.9.1