Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1248081imj; Sun, 17 Feb 2019 01:16:19 -0800 (PST) X-Google-Smtp-Source: AHgI3IbVpbl2adR6zgzyFtUvagaRGSl9cS+SN8hc3ynM+hbdoXplXNpmEklRq0W+83YCyUVzB8P/ X-Received: by 2002:a62:76d4:: with SMTP id r203mr18661290pfc.15.1550394979548; Sun, 17 Feb 2019 01:16:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550394979; cv=none; d=google.com; s=arc-20160816; b=W27JASR7zxlOiN1214K7y0FGCKkpzJfOgHeiKvK9kA5J1Q0+Rzxrtv5t5VVXT+FBZo AtXIFeJ2Kzyq0K9dmb7R4K94vN1NSvruJUnrPe4nXqoXyGCQ/0Wf6cVJb2hTSWie5JCV wTTOIQi050ODMGvr+HEEBBefw4veBL/J394AhwLGcZjWJR1/CbbkNmgzTdWO6KS8xgfJ mWP3NNMZVmpmhHl4NolYSpCoBiIhtmaptaYGhsOxhpcvcxpt3yP3k9W89MRCaVL2e3KX iKRKLWovUJg+6j529ISXVxv5Ys2BLGnx5fp3VMC6rDOqGla1qLgRmvsdNqD7ss9qhTjW RbfQ== 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=K2lkHzHScAtRoDasp6m5KClCAoy0Q6tIeDouEtoam+I=; b=zGjaxgzKgMbNvwLehsMycvd+7XTk39JYeLKh2FAfE2umuWT6og0juFW9CtadvrMqjq fvjFWodKHlGM9wzoIv0m28ZGsjAXpbY4V9TITClGvp9FB5VZc8hHxJYNUa2OHLM9ZKaD FsoMBR1B4AW15g7lJ/dUst91BGXAitG/Kx2MLIxvoWC8twe8Fo8idmgdta7PInPnHlJR 6TtdtVWfVSP6rQ3AUrWUG3GTy9Yh4kuoavMaZWBlgsDzOw7JxrXsApuIAhjoxJU9wo0d aDn3FQ7HNzzIHJbuK5BkYr/7zgTFDvyffHYXD2STECrkwqTqVfeGTngqScCNfW9kluQh 7dYg== 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 y17si9973707pgh.353.2019.02.17.01.16.03; Sun, 17 Feb 2019 01:16:19 -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 S1727451AbfBQJIS (ORCPT + 99 others); Sun, 17 Feb 2019 04:08:18 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:64464 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726371AbfBQJIR (ORCPT ); Sun, 17 Feb 2019 04:08:17 -0500 X-UUID: 131e1c77ff194d87b110f86db6e69923-20190217 X-UUID: 131e1c77ff194d87b110f86db6e69923-20190217 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 451143807; Sun, 17 Feb 2019 17:08:13 +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:11 +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:04 +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 10/22] iommu/mediatek: Move reset_axi into plat_data Date: Sun, 17 Feb 2019 17:04:48 +0800 Message-ID: <1550394300-17420-11-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: 9B52061A01687CFC699728521D9C1DE4767714761F0BD8886C5481C788BBAEC42000:8 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 --- 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 483f6e8..2cf814c 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, @@ -748,6 +747,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