Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp878994ybl; Wed, 21 Aug 2019 06:58:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdcSU6Zt4uYPgr4tO3AD8/l3h6KnpKfcoGHPpuQqO4FGgxE/Lmqkz7SuvdD6/72rTBkQRo X-Received: by 2002:a63:f13:: with SMTP id e19mr22762150pgl.132.1566395899702; Wed, 21 Aug 2019 06:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566395899; cv=none; d=google.com; s=arc-20160816; b=anaXzWk1O+qPT2CiJUVj4C6KU68WQ+gKN/ZqZjSTW1uj2ZJTJlPbOswryTPvWxDv3x ufxPSGhk6gpPY6yzfYOAyQdM22RgqnuR5l3zkimhti7wy8yXsV3UtQ3SKIHA+7jN+K95 hhqhYpv8mJoYmTdYhxzQA2Y7N7agoyg4DcYNmaB0IToW5mD8mXBUTHXaNhaMDEhJ/p7Z X5xSVKKeoLYpFOK/OzpGZtKEpoKZb7YrABAfiFEN5GwAA95eRMkTLQvyuaFYwtpoakqu sXb5lYvDM3C3qh49xOrdeAxXZIJnmJg++c8LV7HyDKjiVQp9a9TvCqHPTCj9dbDBY+2T FwWQ== 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=BXyqqhZn38L8XoDkaN4A/BMtq2ozih7G/ofMlmweAEw=; b=X1EIDj9lMc+HTk16sdjQioYFg8ho4iG023C5Hsdt5mq9K+bK1KxiAZ68mF8eaMWNb+ flUTaRP9weSivQsMOxndFYnd0anFJgWyHaP4WhVBEbtV3hF8A5LBV+qqR/pfpd/0GyfY G5CIVVIn/4g8Dkm7z7qnXSgDf/u7QttiaEO0qhRWudK5NHY7lOYwzbEWYg+lLxD19Dc4 UpEBuhuhM2mG1fBBasrBYgdDx12hmRkMNRI00UXQ8snzBwo57hFqZpepr+i9sW81Eabm R3sPAFAi61qpPVyyIGZINl+SOb91yLhc1YUVyFML1+IKHhDz8sJdQ+TeuTx92nz+Sy/Y tdcA== 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 r3si15022707plb.14.2019.08.21.06.58.03; Wed, 21 Aug 2019 06:58:19 -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 S1729262AbfHUN4c (ORCPT + 99 others); Wed, 21 Aug 2019 09:56:32 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:30904 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728980AbfHUN4c (ORCPT ); Wed, 21 Aug 2019 09:56:32 -0400 X-UUID: c149dd8cc027403da550eeaa6a165d75-20190821 X-UUID: c149dd8cc027403da550eeaa6a165d75-20190821 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 1251908475; Wed, 21 Aug 2019 21:56:20 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 21 Aug 2019 21:56:20 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 21 Aug 2019 21:56:19 +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 v10 14/23] iommu/mediatek: Move reset_axi into plat_data Date: Wed, 21 Aug 2019 21:53:17 +0800 Message-ID: <1566395606-7975-15-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1566395606-7975-1-git-send-email-yong.wu@mediatek.com> References: <1566395606-7975-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 In mt8173 and mt8183, 0x48 is REG_MMU_STANDARD_AXI_MODE while it is REG_MMU_CTRL in the other SoCs, and the bits meaning is completely different with the REG_MMU_STANDARD_AXI_MODE. This patch moves this property to plat_data, it's also a preparing patch for mt8183. Signed-off-by: Yong Wu Reviewed-by: Nicolas Boichat Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c | 4 ++-- drivers/iommu/mtk_iommu.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 947a8c6b8..b43f36a 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -577,8 +577,7 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data) } writel_relaxed(0, data->base + REG_MMU_DCM_DIS); - /* It's MISC control register whose default value is ok except mt8173.*/ - if (data->plat_data->m4u_plat == M4U_MT8173) + if (data->plat_data->reset_axi) writel_relaxed(0, data->base + REG_MMU_STANDARD_AXI_MODE); if (devm_request_irq(data->dev, data->irq, mtk_iommu_isr, 0, @@ -774,6 +773,7 @@ static int __maybe_unused mtk_iommu_resume(struct device *dev) .m4u_plat = M4U_MT8173, .has_4gb_mode = true, .has_bclk = true, + .reset_axi = true, .larbid_remap = {0, 1, 2, 3, 4, 5}, /* Linear mapping. */ }; diff --git a/drivers/iommu/mtk_iommu.h b/drivers/iommu/mtk_iommu.h index d1a1d88..8d3b525 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -38,7 +38,7 @@ struct mtk_iommu_plat_data { /* HW will use the EMI clock if there isn't the "bclk". */ bool has_bclk; - + bool reset_axi; unsigned char larbid_remap[MTK_LARB_NR_MAX]; }; -- 1.9.1