Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1247318imj; Sun, 17 Feb 2019 01:15:13 -0800 (PST) X-Google-Smtp-Source: AHgI3IaE+VMuOBLgB1y7C8UYpF6XgMaFM6kRhvoU/Knu8dUAz7cvQKdhZ5ZJl1hmL3wl0hUO5ZpL X-Received: by 2002:a63:ce0e:: with SMTP id y14mr13567597pgf.145.1550394912928; Sun, 17 Feb 2019 01:15:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550394912; cv=none; d=google.com; s=arc-20160816; b=ymkSftknBzifdiF+KA9pC/9dcnAZiqFkmKSTSbkb1kt98g77SkHyj4q6k0wPx2Zjov phGQtvSegP7HHHhCVPjNd9KidgT/nlEDDuCCnbdb7gwQIPEtoLRriRcC9sPJlgfdtoJj cr9Rmx3WP5hF30EkDVajMLBL/KgFYBrV6sCA+Fl8tOnURd1CMkyePrpATn5kX8DxlVEC HqIT/D52zIgm5VmR7C8lK2Bi21PlRuLXSmO4dWTRt7uSc9TjdYopm+uU03i6pv1Pdwor dADVd3QSYBLsebH1d2uNt3Hr8wUt8Df8CX7npEAq+byATsO2VKFEsRNVzm8RV7wMrHlo PDbg== 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=6ETd491ilReDIhNLWDgHyHIP00xXMxYKNlOCL3rHCmk=; b=eRext01YRj3HJP12eGW8We9wDj2B9aaxG0Gx4SJ6lCyTiM2r0dcsYO31ntQ1HhI+kD 6EwdMunJra70XokBpdrC7qLCMN67h1RIRZC5kloc5N8tfqeQYDy8Q5acV17Px5RJ6/sE RjtaWfaLq8jPlyXTz0q6W14X8KLon6Jm4FqJJ3tWg0u9+un0wZIjhfKo7PN96FfLIDxm vi50c1uB3Ph/xao9Y2EsXb0Cdl0h7Njgu3KKvKfsRmfPzeHcpPNqgHnL8vZ+RAJXEH+4 aV1QSh/1uFPhocSFVqUz/N9ivgRywPwYXS7rxBUrtG/mEpksO4TvkC7HwHxGYSSppT/Q QpkQ== 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 g4si10570424pfm.85.2019.02.17.01.14.56; Sun, 17 Feb 2019 01:15:12 -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 S1727497AbfBQJI0 (ORCPT + 99 others); Sun, 17 Feb 2019 04:08:26 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:5985 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726371AbfBQJI0 (ORCPT ); Sun, 17 Feb 2019 04:08:26 -0500 X-UUID: 84f37e28f22d42b4abaeabbe5c6c04ee-20190217 X-UUID: 84f37e28f22d42b4abaeabbe5c6c04ee-20190217 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1799171365; Sun, 17 Feb 2019 17:08:21 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sun, 17 Feb 2019 17:08:20 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Sun, 17 Feb 2019 17:08:19 +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 v6 11/22] iommu/mediatek: Move vld_pa_rng into plat_data Date: Sun, 17 Feb 2019 17:04:49 +0800 Message-ID: <1550394300-17420-12-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550394300-17420-1-git-send-email-yong.wu@mediatek.com> References: <1550394300-17420-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 229EC6650D801997B395449AA5DD41CD734094E3250E5AB07BBE8074571917BC2000: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 2cf814c..57aa526 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]. @@ -740,6 +740,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 b46aeaa..f170a1d 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 has_vld_pa_rng; unsigned char larbid_remap[MTK_LARB_NR_MAX]; }; -- 1.9.1