Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3149294ybi; Mon, 10 Jun 2019 05:23:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSdd+251WasMYnHHkB+XufQju9AL06zTqoo3w/FJTXC6n34diOIs7EKUMDHLPj1RD3Dx10 X-Received: by 2002:a63:e54d:: with SMTP id z13mr15435950pgj.132.1560169416457; Mon, 10 Jun 2019 05:23:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560169416; cv=none; d=google.com; s=arc-20160816; b=kmx4wg9wTX88Qb9Z5bIdO0a9hV9+pfjHVPGChWGvcMFDIs+5SAOby3yigizl8g0k1g y3xpgtQoteuqztrwy8bpjRoZy0upJDI8gW4Y3Kf1uAtqlqXy7daLMtiLOwt+2I31lkLv eaXfdTMeJSpwjrvXPT2FD88tpz8pNA2Sa5dwYOturVQASx5Gcmft+H4jJrnk5adsww3H ZlslBIpZis4LTs8EZR05GYjf/Zn5XT+tDbE8mI64G5KCs451hmeOraK1XLCxzD8C2opH luY2xkuqAZHxXq5HZJ+v0OtJaqLZCxZK7/uM28FjHS7Rw65mEUzW/3qw/+EuxcSD3pws 6qIg== 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=ewfXBQYuraeQNDVaAQxG+y66KbPnsEpv98n4HDxdiaQ=; b=pGiKAmOqcLtx/bfP4jp1hL12wnoyNq6DYUBqaInT3IZ09kDyQ4HVPL5DFEsHQ5bp3R aUTmTd77BFP/hAKYrfpuH/WdkjZm61ZShUyD9UQO6xGzbK7VbmIJccftPRqtJxRU7Y5r jboNebRFM1QDgLChghqa6tndWns2KMz85mUt3gnzLLw/UWJyG1BHAaI7LM/3pYKVNjaY 0f1RHkPD97KwctN1Yd5gx7lKTggi/unobOymWeOAY6Cb+9vFgGlYq2e0C/hgYTHpAcDf MvGG7zPB5u1iwv5cX8akHAiUboEOwjSWTS2eSmQLcq8g/gk+BvyzdVielPJ7h+7AwgZp L1gg== 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 n19si9427018pjo.31.2019.06.10.05.23.20; Mon, 10 Jun 2019 05:23: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 S2390030AbfFJMWP (ORCPT + 99 others); Mon, 10 Jun 2019 08:22:15 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:6063 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2389001AbfFJMWO (ORCPT ); Mon, 10 Jun 2019 08:22:14 -0400 X-UUID: 33ed1d42f958437190f5af19f4f3d43a-20190610 X-UUID: 33ed1d42f958437190f5af19f4f3d43a-20190610 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 16363311; Mon, 10 Jun 2019 20:22:04 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 10 Jun 2019 20:22:04 +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:22:02 +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 19/21] iommu/mediatek: Rename enable_4GB to dram_is_4gb Date: Mon, 10 Jun 2019 20:17:58 +0800 Message-ID: <1560169080-27134-20-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 This patch only rename the variable name from enable_4GB to dram_is_4gb for readable. Signed-off-by: Yong Wu Reviewed-by: Evan Green --- 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 86158d8..67cab2d 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 753266b..e8114b2 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -65,7 +65,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