Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1248987imj; Sun, 17 Feb 2019 01:17:47 -0800 (PST) X-Google-Smtp-Source: AHgI3IYDfoWCON8qI/r6BG2FaH9TznIdlD5Op+tXhG8yJ7ZaKOgj4OxSEeQIvUPP2Wc3SRGzbQl3 X-Received: by 2002:a65:609a:: with SMTP id t26mr13241480pgu.411.1550395067198; Sun, 17 Feb 2019 01:17:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550395067; cv=none; d=google.com; s=arc-20160816; b=En0E5qSLWJeinBXKuYdlivol2oHsrsbUWlc5jA/oLotGn6LtGlNTwe2J1ELsRZSUj/ bERuSCmr0/okZE1L3UuFg0YUR5ujMqclSVGEwSwG+LWx3baq7hwq5QeZTITWzUX6idhi YnNxgZplEj+0EQh3pfanRuWXGJE2kr75zcMTCiz/ifynPhsHQxAW22VB7jW3tWSsIoCR JD7PG1RWUsVzi1cWce8/q9fdRYvtCGXH5j92+sW39BsxCKmcuObGO61VyO0zhZq1yvr5 +GXsW2rYaR3o28gH+SXC6jwY/3FwCraG0BF4Xy0lG9qRvVjAHSav//Hd/4msO0SVOrdg 0ApQ== 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=lszZUiABVeKrks6SzVHRHIy4LNXyK/P8KAoCry4CvQY=; b=S4hT0Uwn5fT3DL1T9rdXeAEBauCaSFN1u7kMk8zD6rewMtbQD+wYU0jv1SoRkNcC73 SNdur7sOjHENltrkJzbSRr0nIQm0WBeUZ/Yiyl+QjTD37JMBQNTYAlimjzBSsp+k4Xr4 Svyqd7IO30cOmM1dg+oYf0KZGLb3tWwHrBLengWoCF471piaJty0jhel4DuCMMViJrii BoRhoAeUzLSJxid4mp0YrDxNEQy1K581wnD4wWbOjFdjT3/Xog3kUJvNqMM2hiuPTi46 OzV3as/xHGvkNh2wTWiA3PG/FaHW1OgT3E54/4iYwbRSdY+JrlMieg2ub6u2zdXcYOU4 rYHA== 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 e9si9874762pgk.173.2019.02.17.01.17.31; Sun, 17 Feb 2019 01:17:47 -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 S1727882AbfBQJJg (ORCPT + 99 others); Sun, 17 Feb 2019 04:09:36 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:41745 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727866AbfBQJJe (ORCPT ); Sun, 17 Feb 2019 04:09:34 -0500 X-UUID: b797d83fc235450d944ad4fbfaf9790a-20190217 X-UUID: b797d83fc235450d944ad4fbfaf9790a-20190217 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 441582375; Sun, 17 Feb 2019 17:09:29 +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:09:27 +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:09:26 +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 20/22] iommu/mediatek: Rename enable_4GB to dram_is_4gb Date: Sun, 17 Feb 2019 17:04:58 +0800 Message-ID: <1550394300-17420-21-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: 5B0FB1D48A92A447B225EC4968B7729CBEFB9D291F130389DD051641658FA1BE2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch only rename the variable name from enable_4GB to dram_is_4gb for readable. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 10 +++++----- drivers/iommu/mtk_iommu.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 8742841..0277396 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -382,7 +382,7 @@ static int mtk_iommu_map(struct iommu_domain *domain, unsigned long iova, int ret; /* The "4GB mode" M4U physically can not use the lower remap of Dram. */ - if (data->plat_data->has_4gb_mode && data->enable_4GB) + if (data->plat_data->has_4gb_mode && data->dram_is_4gb) paddr |= BIT_ULL(32); spin_lock_irqsave(&dom->pgtlock, flags); @@ -554,13 +554,13 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data) writel_relaxed(regval, data->base + REG_MMU_INT_MAIN_CONTROL); if (data->plat_data->m4u_plat == M4U_MT8173) - regval = (data->protect_base >> 1) | (data->enable_4GB << 31); + regval = (data->protect_base >> 1) | (data->dram_is_4gb << 31); else regval = lower_32_bits(data->protect_base) | upper_32_bits(data->protect_base); writel_relaxed(regval, data->base + REG_MMU_IVRP_PADDR); - if (data->enable_4GB && data->plat_data->has_vld_pa_rng) { + if (data->dram_is_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]. @@ -611,8 +611,8 @@ static int mtk_iommu_probe(struct platform_device *pdev) return -ENOMEM; data->protect_base = ALIGN(virt_to_phys(protect), MTK_PROTECT_PA_ALIGN); - /* Whether the current dram is over 4GB */ - data->enable_4GB = !!(max_pfn > (BIT_ULL(32) >> PAGE_SHIFT)); + /* Whether the current dram is 4GB. */ + data->dram_is_4gb = !!(max_pfn > (BIT_ULL(32) >> PAGE_SHIFT)); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); data->base = devm_ioremap_resource(dev, res); diff --git a/drivers/iommu/mtk_iommu.h b/drivers/iommu/mtk_iommu.h index dedf05c..90e98a6 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -66,7 +66,7 @@ struct mtk_iommu_data { struct mtk_iommu_domain *m4u_dom; struct iommu_group *m4u_group; struct mtk_smi_iommu smi_imu; /* SMI larb iommu info */ - bool enable_4GB; + bool dram_is_4gb; bool tlb_flush_active; struct iommu_device iommu; -- 1.9.1