Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2168667ybf; Mon, 2 Mar 2020 03:23:43 -0800 (PST) X-Google-Smtp-Source: ADFU+vvbwyP/jPe8HLW3gFaPxj2z0BiYF0fw99Dli9L/IX3xkfBwTW1DgoxXwn7pqnCQ2DvVHqYz X-Received: by 2002:a05:6808:301:: with SMTP id i1mr2486741oie.19.1583148222936; Mon, 02 Mar 2020 03:23:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583148222; cv=none; d=google.com; s=arc-20160816; b=wCukP8onx2eVbn931YLS7muMC5LwBybLCZYzb2COpRD8fsLLJr1N6zQJKn6bSPSoXt 11+XFsDPXca7gt1XdM1Xsw7QF3hGhfoA1uLRYxykv6j+I72QaEVf+e9hoASHXi8eMTMv KLEyry9QDolmWKSkZH4BovZ2aNkNBeIpP1KFvu4drrsRlN2bq2ytTwHaqP4ku5ZO4GZM FRUv2K+54V8n2oQvPb4fl/3E9FLi9xHXkX3Iv0PUMo9ogf2qNeCim5fJ7opBfuH4wuZY DnNlywea14g81gtmxBKuiOrNWdjUL1YpYoqui+hWfq1hNRUdpttIPzjhkb5tXquVYG6X Hh/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4twAZzpqE7OZHthVARi42fhoM9wMIzUTa1b3XIbc4u0=; b=DFHIJQN0uGGjW7J6uqxzJ91vP/Ya8gkiwvKTNeVB9Z9AHK+5RL48p9infj5aRQ3c1w EfxENooMsXdZomBdcHoRV91NOGfdlYRPCMUA+M6bHgF1uVofKgIEHpeyQSFjBNeI4c+0 4TyQDuo1sbbBj2mIrQGYLHEtBGPXEj7wguiu61gah301OccdFiKFnNtBur4PNBrsJw8A hIkYU+cLQX6zxyNKEp64I2fBKntyxoQ75mfLE8hx0AMSwThsyk5MVc51mKFMIMctRkRg rHvVI9m699ISSN9M7cEusy8Mvag+k5OGgbHl4WvrVfZwhv6GLFd88JxyUR81ySCtTcAY 5Ujg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="HrqcWs/t"; 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 p3si6471694oih.186.2020.03.02.03.23.30; Mon, 02 Mar 2020 03:23:42 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="HrqcWs/t"; 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 S1727619AbgCBLWW (ORCPT + 99 others); Mon, 2 Mar 2020 06:22:22 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38222 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726740AbgCBLWW (ORCPT ); Mon, 2 Mar 2020 06:22:22 -0500 Received: by mail-wr1-f68.google.com with SMTP id t11so5680565wrw.5 for ; Mon, 02 Mar 2020 03:22:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4twAZzpqE7OZHthVARi42fhoM9wMIzUTa1b3XIbc4u0=; b=HrqcWs/tM1UMeqgqQDpvy3jpqRSAaC9KOUedVpPAAvQXG3RKGJEGAKffHVNPColesQ XmJC8gVr91n0yVRfBh5hJIgxN9YGBInf8dxyQV9MOR+vauyVfx/rs1trGy5WKr+ppnSY xPNcptl/HEFg1e2S8eAWVFv4Q5y9PVMn9NqIV3MYzpRlBTcz8yFMsOTa1HGbIGY1K7Gt GsFLln6giCDJ1dDj49uhcLCoEnMDB4qd9U0rI0iX9KSIwHGJNAc03zON9tAvUnNuiZdQ xeZEus/ihesqcBQ/4+ERXw6UkZGG0pE7kquuOyrm+1jE6cQq8pWiEkXWYx+nD0T4SWzN oCew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4twAZzpqE7OZHthVARi42fhoM9wMIzUTa1b3XIbc4u0=; b=qYaRLJBud7lVs+zteAHr4ZBRzybCmAoDP/dLel5r5caL2EEygCeRyzpPb68FRNhvDL EMzZFzO5G0Mwe4h9dvB6z4zdbOD9K8znLGGPdQS57OmtU5ZDZimQLqnGGs17RQHiw8Ch WAtspgLcDxNcKWJwauKqWSaS+gsYRtQ9rIGrkzGNRIrUQ+BhyrAT2pHl3LUjMYosnW8n q+w98AjdU9gCcxwKBq86PZGDS6DOptqpO4b4l2K1kuUHctf2FziLW+FT7AVVSWPONMPk XgrXeD/nLizqzRMGfTktv86DGmZkp7BuN12qFo7JSAw53inv7Czkm++rwn1Xpp8WbOx8 5riw== X-Gm-Message-State: APjAAAUJYCFxrH8dTbGY6eH24vRqJav/vyBtOmr7DWedpGvtLk5ksSiK 2Wb703EZKW9FKHrYvZjbBOw6Dw== X-Received: by 2002:adf:dfc2:: with SMTP id q2mr21399020wrn.209.1583148140211; Mon, 02 Mar 2020 03:22:20 -0800 (PST) Received: from localhost.localdomain ([2a01:e34:ecba:5540:6f5c:582a:cc84:32f5]) by smtp.gmail.com with ESMTPSA id j14sm28398441wrn.32.2020.03.02.03.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 03:22:19 -0800 (PST) From: Fabien Parent To: linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux-foundation.org Cc: matthias.bgg@gmail.com, joro@8bytes.org, yong.wu@mediatek.com, ck.hu@mediatek.com, Fabien Parent Subject: [PATCH v2 2/3] iommu/mediatek: add pdata member for legacy ivrp paddr Date: Mon, 2 Mar 2020 12:21:51 +0100 Message-Id: <20200302112152.2887131-2-fparent@baylibre.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200302112152.2887131-1-fparent@baylibre.com> References: <20200302112152.2887131-1-fparent@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a new platform data member in order to select which IVRP_PADDR format is used by an SoC. Signed-off-by: Fabien Parent --- v2: new patch --- drivers/iommu/mtk_iommu.c | 3 ++- drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 95945f467c03..78cb14ab7dd0 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -569,7 +569,7 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data) F_INT_PRETETCH_TRANSATION_FIFO_FAULT; writel_relaxed(regval, data->base + REG_MMU_INT_MAIN_CONTROL); - if (data->plat_data->m4u_plat == M4U_MT8173) + if (data->plat_data->has_legacy_ivrp_paddr) regval = (data->protect_base >> 1) | (data->enable_4GB << 31); else regval = lower_32_bits(data->protect_base) | @@ -786,6 +786,7 @@ static const struct mtk_iommu_plat_data mt8173_data = { .m4u_plat = M4U_MT8173, .has_4gb_mode = true, .has_bclk = true, + .has_legacy_ivrp_paddr = 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 ea949a324e33..4696ba027a71 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -42,6 +42,7 @@ struct mtk_iommu_plat_data { bool has_bclk; bool has_vld_pa_rng; bool reset_axi; + bool has_legacy_ivrp_paddr; unsigned char larbid_remap[MTK_LARB_NR_MAX]; }; -- 2.25.0