From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EE3EC433DF for ; Mon, 25 May 2020 06:25:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 756A5207DA for ; Mon, 25 May 2020 06:25:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="a+/DjBX5"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="vFQKB6uI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 756A5207DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HipbThMlDDy8aPAw4xXPh2m6+DcAX3CBupoKRUw/6DY=; b=a+/DjBX5d5P5Z4 zMLKew0f3qKwp+XDW7YVDjec3Iop72CaxAa72QOrZArQ8P+hY6MqMO3GykigIJgxirhyrznqepZsr NQ6QDzCqnCE1CApn+zdBUz3XYZZDXfSEXcK172QgKNXTWucbv8GidPWmusopGxe3jR77I+JUCBmps t5K152etMADpp6XVq/i084Rii6zp+8Bt5NX/d1fWcYl1aE6f2DSQ8hdcAgtLJhj6y9+FrSmp2txnJ sR4BL+mvpPKU15OEs0VgdMN7jEi0TY3lcUnXI/PxeSJyecyQY92qvhrIM+zmS0TPzjtq7SgUb0wMt 7FHIUw3WkfnLQoxPQA5Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jd6YE-0002WV-0Q; Mon, 25 May 2020 06:25:30 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jd6YB-0002Vt-E5; Mon, 25 May 2020 06:25:28 +0000 X-UUID: 14c4849fba09432d947b986e256a57d2-20200524 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=3hx+xuZwk+qJ8HxGZOVEgrk/RUaXq486bK4HGdRWFOY=; b=vFQKB6uIpltNUP1R8bR+gKN4Z3eBtERsgIOhoVCsnC4fmBZoGA5mq7uvzd9fdfELiFFYuB+xAtBMFuBbBC0gnwOyMEFNxzizMuDAIEwUUdAnhYje6SVJEb4qnlk/BWAb/dPt9Kw8GA1lInFq7pFVCcz/pslO/hYAkwytA4RwycE=; X-UUID: 14c4849fba09432d947b986e256a57d2-20200524 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1038143137; Sun, 24 May 2020 22:25:21 -0800 Received: from MTKMBS32N2.mediatek.inc (172.27.4.72) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 24 May 2020 23:16:20 -0700 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS32N2.mediatek.inc (172.27.4.72) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 25 May 2020 14:16:17 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 25 May 2020 14:16:16 +0800 Message-ID: <1590387275.13912.7.camel@mhfsdcap03> Subject: Re: [PATCH v3 3/7] iommu/mediatek: Disable STANDARD_AXI_MODE in MISC_CTRL From: Yong Wu To: Chao Hao Date: Mon, 25 May 2020 14:14:35 +0800 In-Reply-To: <20200509083654.5178-4-chao.hao@mediatek.com> References: <20200509083654.5178-1-chao.hao@mediatek.com> <20200509083654.5178-4-chao.hao@mediatek.com> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: A8DD666DEB4BBAC87549C627945CC7E41AC0342C681DB12F322F811B674E33472000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200524_232527_479794_1C3AD684 X-CRM114-Status: GOOD ( 15.59 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, FY Yang , wsd_upstream@mediatek.com, Joerg Roedel , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Rob Herring , linux-mediatek@lists.infradead.org, Matthias Brugger , Jun Yan , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Sat, 2020-05-09 at 16:36 +0800, Chao Hao wrote: > In order to improve performance, we always disable STANDARD_AXI_MODE in > MISC_CTRL. > > Signed-off-by: Chao Hao > --- > drivers/iommu/mtk_iommu.c | 8 +++++++- > drivers/iommu/mtk_iommu.h | 1 + > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c > index e7e7c7695ed1..9ede327a418d 100644 > --- a/drivers/iommu/mtk_iommu.c > +++ b/drivers/iommu/mtk_iommu.c > @@ -42,6 +42,8 @@ > #define F_INVLD_EN1 BIT(1) > > #define REG_MMU_MISC_CTRL 0x048 > +#define F_MMU_STANDARD_AXI_MODE_BIT (BIT(3) | BIT(19)) > + > #define REG_MMU_DCM_DIS 0x050 > > #define REG_MMU_CTRL_REG 0x110 > @@ -585,7 +587,11 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data) > } > writel_relaxed(0, data->base + REG_MMU_DCM_DIS); > > - if (data->plat_data->reset_axi) { > + if (data->plat_data->has_misc_ctrl) { > + regval = readl_relaxed(data->base + REG_MMU_MISC_CTRL); > + regval &= ~F_MMU_STANDARD_AXI_MODE_BIT; > + writel_relaxed(regval, data->base + REG_MMU_MISC_CTRL); > + } else if (data->plat_data->reset_axi) { > /* The register is called STANDARD_AXI_MODE in this case */ > writel_relaxed(0, data->base + REG_MMU_MISC_CTRL); > } 0x48 is either STANDARD_AXI_MODE or MISC_CTRL. Thus, if (data->plat_data->reset_axi) { xxx } else { /* MISC_CTRL */ xxx } No need add "has_misc_ctrl". > diff --git a/drivers/iommu/mtk_iommu.h b/drivers/iommu/mtk_iommu.h > index 1b6ea839b92c..d711ac630037 100644 > --- a/drivers/iommu/mtk_iommu.h > +++ b/drivers/iommu/mtk_iommu.h > @@ -40,6 +40,7 @@ struct mtk_iommu_plat_data { > > /* HW will use the EMI clock if there isn't the "bclk". */ > bool has_bclk; > + bool has_misc_ctrl; > bool has_vld_pa_rng; > bool reset_axi; > unsigned char larbid_remap[MTK_LARB_NR_MAX]; _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek