Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3147558ybi; Mon, 10 Jun 2019 05:21:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUKaAK11HwZ+oOxQhHsU6hRymB59YTqyL9tHxqDAVAtXuG4nT1+w5k4uywT6dKo2wRHRc0 X-Received: by 2002:a63:da49:: with SMTP id l9mr15520401pgj.320.1560169296506; Mon, 10 Jun 2019 05:21:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560169296; cv=none; d=google.com; s=arc-20160816; b=v64/vjSzI8v8VRLEVbFqtPF/H040rApFk48hUKy5NJSl05gAnu8U0LsoENmgp6VQLf I8qeSbUUlQIcwfl8evpHdAU/uSSpFmB22CmFv0ZXpEqNMwN53wPx1z/ktVy/DdxWgQhW Y1cGDBrZh+if7GWR1mxQYWxvSgu3887sLggt5MOv+fQYrRyGmiy320Tx31k/qfjiOOpW EJs79GRfnN79g16eSNQQSWHOnxRKNr/T0YPfOVAjTel103TQJbHqyfXxBTpG449Emiqd SqyWYlPa4ElN1sb4GkvC74f0VIQwupnQr77Fvl4bPsaOfAAnNSeMBnQG+chPrM09MLw6 2iFQ== 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=4HMdmHvjABBEhGRIArgWeaRnUaWTnZhYFgGNbDjcCwg=; b=D0dS6Q2nukkA8snsTpJo6oBhOklpG+d6CRkgkgwnKY67/dLcR+UGyNGuQY0Va7Zwqq Q2j+uwaNjHxSJARzRAkzhFjS/2TYNymHgQOQ1PbhmCssER2RzWoZ5JlV6OBaV25SRCUc rpWD0C/Qa1qHO1qXJMnbUVRjiaI17yDbORsbFOYhOKcXrMbmITsUPZxchExyTBNkCdM6 +lnJUCgMlQtX5o7X5x+f4giPd2YUET9KGfTt5xNpyYO7D2pScl6olt3rQ1TqOy+b3nFN XXo0ZI6gJvq8XtafuYZl3hIYF7sXR0I7+ZF4dCPmE4HdUxfE7D8SwaTNv/4VfaSxEXjb j5CQ== 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 m26si9236988pgv.388.2019.06.10.05.21.20; Mon, 10 Jun 2019 05:21:36 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389950AbfFJMUf (ORCPT + 99 others); Mon, 10 Jun 2019 08:20:35 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:64555 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2388952AbfFJMUe (ORCPT ); Mon, 10 Jun 2019 08:20:34 -0400 X-UUID: b08e75b4c9524498beadf40a1c9f25b9-20190610 X-UUID: b08e75b4c9524498beadf40a1c9f25b9-20190610 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 530537684; Mon, 10 Jun 2019 20:20:26 +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; Mon, 10 Jun 2019 20:20:25 +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; Mon, 10 Jun 2019 20:20:23 +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 v7 10/21] iommu/mediatek: Move reset_axi into plat_data Date: Mon, 10 Jun 2019 20:17:49 +0800 Message-ID: <1560169080-27134-11-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1560169080-27134-1-git-send-email-yong.wu@mediatek.com> References: <1560169080-27134-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 --- 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 d38dfa2..8ac7034 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -557,8 +557,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, @@ -752,6 +751,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 61fd5d6..55d73c1 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -46,7 +46,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