Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1426888ybl; Fri, 23 Aug 2019 20:09:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGw+iVLPT15SdsVoTPpgojQ8Opll6SCyh17wcOafpi16ojUfzfp6EY8TzPrswNt6zNrkZu X-Received: by 2002:a17:90a:a896:: with SMTP id h22mr8437927pjq.1.1566616180787; Fri, 23 Aug 2019 20:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566616180; cv=none; d=google.com; s=arc-20160816; b=EtIWSEz8VR+8y4nP3hHWCvm13yyaYrC4rex6mU81/NpcC5SX16CgsPVFfKNme18ydf p55mEaRIDKaGBY/uqQ3d5igR4rJj//7Ch4JO05D50CKRr7Fg7ivyNfrig6pxH/UHsPd5 SJnhitq3mYYpbnnGsPbPADljsEcBqSDN8qEFmoOV69fUZp0zu938VIA9Rh4jmaVOxkeJ UT2Ovwi25LhNtnu+Jynmv54LsDkQ9PC6wMmeWQhmooxfDYcgLU3OuI2k8a9VRXrAuhG2 pT5DQ9II6goNhUXcrWIFqoS1GkyWWHixyXf6+mxQfn6OgQZid3lo1Rw2080n3Tj8HHYj EIPg== 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=zgZ3cXgmF90rrjgDlUxort2Zltwqd55VsDy5BIa6I9g=; b=0TG0rHQFCKY9VTMWpGHmo33X0KLbB09rV2mVLek28NtKIDy/j23poZ+Zk7n1NKSDvE NQ6K59PCTLT+0ijZEOjQW4bhhT4CjpeA7BQZ2RKtN88m/TtNMRZdXfrg31ztLo/Tq//m W+gJt4Bjnm/PsoHEsyAS76kCIMjiFZmFOLfQksGaOgcOFVxYSRE4oRARqYN/PtYCG2rI 2f2fY2vfZIRXAsYgAqO3l8IQvUsFzxjAI5erEozitRu96dBCw1pQWNi7tLcOilPGsHfD wu8eljLKht9K3GvrOf715z+hJvQn8un9HXzrO6sm7Jd0TZuJhLZuFytaT6VyIxZvzoo8 A9jQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si3300756pgi.304.2019.08.23.20.09.25; Fri, 23 Aug 2019 20:09:40 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727419AbfHXDGS (ORCPT + 99 others); Fri, 23 Aug 2019 23:06:18 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:7560 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727346AbfHXDGO (ORCPT ); Fri, 23 Aug 2019 23:06:14 -0400 X-UUID: c4640c8a19ae43899d525fbdb27a47cb-20190824 X-UUID: c4640c8a19ae43899d525fbdb27a47cb-20190824 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0707 with TLS) with ESMTP id 108338306; Sat, 24 Aug 2019 11:05:46 +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; Sat, 24 Aug 2019 11:05:38 +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; Sat, 24 Aug 2019 11:05:37 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Robin Murphy , Will Deacon CC: Rob Herring , Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , Matthias Kaehlcke , , , Subject: [PATCH v11 15/23] iommu/mediatek: Move vld_pa_rng into plat_data Date: Sat, 24 Aug 2019 11:02:00 +0800 Message-ID: <1566615728-26388-16-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1566615728-26388-1-git-send-email-yong.wu@mediatek.com> References: <1566615728-26388-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 Reviewed-by: Matthias Brugger --- 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 b43f36a..eaf6a23 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -567,7 +567,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]. @@ -766,6 +766,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 8d3b525..973d6e0 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -38,6 +38,7 @@ struct mtk_iommu_plat_data { /* HW will use the EMI clock if there isn't the "bclk". */ bool has_bclk; + bool has_vld_pa_rng; bool reset_axi; unsigned char larbid_remap[MTK_LARB_NR_MAX]; }; -- 1.9.1