Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11470706imu; Mon, 31 Dec 2018 23:38:54 -0800 (PST) X-Google-Smtp-Source: AFSGD/WHemmuW5Vq5evKja8iCcrWLGSF4Y6su/1z0QgFHPdB3Exw9Qb+T5nUq4l2nf7IeIlKEL2l X-Received: by 2002:a62:1b83:: with SMTP id b125mr41994937pfb.42.1546328334830; Mon, 31 Dec 2018 23:38:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546328334; cv=none; d=google.com; s=arc-20160816; b=t/jNytITaip+RP2AGiEDU6cgiy2WESpF3CNicw+e9rsQZv7KfLAwv9DNZbMPoAvtz1 wQtcOT9+oAhYJMrVjpXDn7RgPidYEt88w1MptbsisMF6Pq4gka5nBEuu63iDdssgNEuE OGjWnI1/mCXSD7xXj7vccY1jI1LBuh/YEtXDE5cx/ohIs17V6qkxuJBCaHKVu2pfrW49 iJRO/IYB/7wNAfVd3ndXhTqZxFf1fDk8uMvfD2J+xjcOKfBGlo/Fic2A/vo95tTXpQE6 G0go0h8/g0tnovT05vc+XYEyNaJjXEmi23y2yFsQIKQqhXWLg0XWQgXqas2yc+y2L2nl XAwQ== 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=6U7CAxG0GEFg2SHIlc2Vjd2WTw6VMz2xhwGe8Zy+Ka8=; b=e6rv0yXPyspE0q7rLQjrH8eut8Llo+gMXyuvCSF82wcDRLxGXzJ1tGNiAOcWG5aU2G /ZO7PFusQSy5+3InHx4cLQ2OvUeQfYR05Zjd9ZUKQr3uAgWvEuSyxo1mjtEwrokPGhLz JuDXGWGzx/SWNoGGSkcNmXJHBZMA/g2LZgLrdBjgF3xkqBtD9wFdfiha06cXAl+qXI6L GEqQgPdwDbPjdfaHtkoi2mgSb6u0KTpSj/KwZ9W/sNLVU/mdYIfq3O1J/IelvKWMaTsA XpcCsVLd2XTbDpHKVk84kFXRdGPtmc3KHFCi3Taa0L56mu8MEMiA0hh5P42/RpBPmgQ5 Z+zw== 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 9si49106439pfq.129.2018.12.31.23.38.39; Mon, 31 Dec 2018 23:38:54 -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 S1728310AbfAAD6a (ORCPT + 99 others); Mon, 31 Dec 2018 22:58:30 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:39998 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728271AbfAAD63 (ORCPT ); Mon, 31 Dec 2018 22:58:29 -0500 X-UUID: f4e94fcf1a0d423b94277e4dc815d045-20190101 X-UUID: f4e94fcf1a0d423b94277e4dc815d045-20190101 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1382668491; Tue, 01 Jan 2019 11:58:23 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 1 Jan 2019 11:58:22 +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:21 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Robin Murphy , Rob Herring CC: Tomasz Figa , Will Deacon , , , , , , , , , , , Nicolas Boichat Subject: [PATCH v5 10/20] iommu/mediatek: Move reset_axi into plat_data Date: Tue, 1 Jan 2019 11:55:42 +0800 Message-ID: <1546314952-15990-11-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-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 extended to REG_MMU_CTRL which contains _STANDARD_AXI_MODE in the other SoCs. I move this property to plat_data since both mt8173 and mt8183 use this property. It is a preparing patch for mt8183. Signed-off-by: Yong Wu --- 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 35a1263..8d8ab21 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -558,8 +558,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, @@ -749,6 +748,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 eec19a6..b46aeaa 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -47,7 +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; unsigned char larbid_remap[MTK_LARB_NR_MAX]; }; -- 1.9.1