From patchwork Mon Mar 2 11:21:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11415365 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75EE91580 for ; Mon, 2 Mar 2020 11:22:07 +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 541B321775 for ; Mon, 2 Mar 2020 11:22:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OjI9PsDb"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="NPzYl0+C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 541B321775 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.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:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=vfTWe6tl2jRgoDS0LTkIMpkS/CbdrPr0UPq2tcQl4p8=; b=OjI9PsDbZ3TdQ1 8w2htYMCw1UGBIlPZu50HduHXAnWPQmJ8cSSpm1d7mJxzX6091Lfta4Nf/0aon+9MeHgcBAqb05xv tWsgTElCh1g2htbDNbR7PJsfnPTVVe1Z5ZsQg0xSAKUdZ/VwIKVFCPCMQpujoo31925lkgIgoK/Y/ 27ClekKc/eHHkvjxSQqdUUWg5iEr8AAy/iJK5s1XNofvz3kzmINod/ShKWFawW1v8WQmaAVEL4stZ PMgKSNh7mYhCwOUQXCq7ilO7gvdXa+Rds2Pwan0WPT4z540frkclSU17ow3TSDNsNyx2G9XaSsnxr h9tHsug3MtnjwuSG7e9g==; 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 1j8j9C-0007wn-3i; Mon, 02 Mar 2020 11:22:06 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8j98-0007w9-Ry for linux-mediatek@lists.infradead.org; Mon, 02 Mar 2020 11:22:05 +0000 Received: by mail-wr1-x444.google.com with SMTP id t11so5679136wrw.5 for ; Mon, 02 Mar 2020 03:22:02 -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:mime-version :content-transfer-encoding; bh=eHZJoauDU3YCd4oo6H8UkUj4vcKpuKTOVNgGI3sKcA0=; b=NPzYl0+Cj9Bodz62CFuc/7zeYsqpkh13Et0PpWoBeAy0TS2FC5OplEhDkxAYsc7Uvp GkkjKKcMZX9GWQNuJ5iT4Dq6TigXqR+mvYZZJpZyWpiCVEjb9PJ9fvCRFFGTnOQ4LZkO YzxSjml2OP392/Scf5dO8G7l4Kmh5NyMy/neFvB5mwjAoWkrkHhTs/jdvRjF9gs4KE8M kyZFxBfe6c7nR6gxQNu1/BoVNv9QgAajUc8QZpwFJUc4A11WKRDG7YBLYwsOMd2im58i CO7l/S5+9YSI9y0Ts7mQtTlB+k0k2jRGaGJRBOLGJ/oGOpWl2+2d566XLfXw+zwRHKS3 jmFQ== 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:mime-version :content-transfer-encoding; bh=eHZJoauDU3YCd4oo6H8UkUj4vcKpuKTOVNgGI3sKcA0=; b=SIJ1oAxcYhQwcrclH9cBh0NYjgeJEG7FjQy9+9MrwiVXiVN+ujDm/+OATow+CEGHNS fmwww0drRORQfrPdSdBzGojcJ/JD7kwhZbJwDhwbqk7DqbtajX6vI/pH20zHY+6w6HaF lCahhbkfkp4x3ojAekk0obKubW2myg4S8kWj5dNKfONroSijkmjyiqOpJicA4a/9Np8q MTILqZFWMNKFF09uKGXcQ1fGIzYD6Cyxys/pkbIwISrnZe4Nkq3BW3c69oBDLyusKV0p MPhxfP7K0qdVgD0qFjq6kOm0UdojBSV3hPHRx3ZHWegohgCZpXfMydwDd+zso8EWBaOZ 5+Qw== X-Gm-Message-State: APjAAAWycf3dQ2Ix8f18yZ14X4VUsJCI/cKRLur3mbsCy8ER3bGP9MVk quaalBmVGbmahei7XF7nl7n8b1RvH0o= X-Google-Smtp-Source: APXvYqyZlRonNGPN6OZje8r6g98mgNwbkojbpYskc2y6mkeqC9MkKpFwp4Ipsn5QsmRq8gTVXPpHag== X-Received: by 2002:adf:dfc2:: with SMTP id q2mr21397636wrn.209.1583148120855; Mon, 02 Mar 2020 03:22:00 -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.21.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 03:22:00 -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 Subject: [PATCH v2 1/3] dt-bindings: iommu: Add binding for MediaTek MT8167 IOMMU Date: Mon, 2 Mar 2020 12:21:50 +0100 Message-Id: <20200302112152.2887131-1-fparent@baylibre.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200302_032203_048349_3891A3F7 X-CRM114-Status: UNSURE ( 8.01 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Rob Herring , Fabien Parent , joro@8bytes.org, ck.hu@mediatek.com, matthias.bgg@gmail.com, yong.wu@mediatek.com Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org This commit adds IOMMU binding documentation for the MT8167 SoC. Signed-off-by: Fabien Parent Acked-by: Rob Herring --- V2: no change --- Documentation/devicetree/bindings/iommu/mediatek,iommu.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.txt b/Documentation/devicetree/bindings/iommu/mediatek,iommu.txt index ce59a505f5a4..eee9116cf9bb 100644 --- a/Documentation/devicetree/bindings/iommu/mediatek,iommu.txt +++ b/Documentation/devicetree/bindings/iommu/mediatek,iommu.txt @@ -60,6 +60,7 @@ Required properties: "mediatek,mt2712-m4u" for mt2712 which uses generation two m4u HW. "mediatek,mt7623-m4u", "mediatek,mt2701-m4u" for mt7623 which uses generation one m4u HW. + "mediatek,mt8167-m4u" for mt8167 which uses generation two m4u HW. "mediatek,mt8173-m4u" for mt8173 which uses generation two m4u HW. "mediatek,mt8183-m4u" for mt8183 which uses generation two m4u HW. - reg : m4u register base and size. From patchwork Mon Mar 2 11:21:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11415369 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5759914B7 for ; Mon, 2 Mar 2020 11:22:39 +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 1FE2821775 for ; Mon, 2 Mar 2020 11:22:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WsPWk2gQ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="HrqcWs/t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FE2821775 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.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: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6QDuVBinDpoRixemrrz2bFEj88bUxrzTpQm7eYMyuwo=; b=WsPWk2gQftZTmC Np68X0IS1xigPAKpJWn6IiUHdoUvMkYCG2HZNOS61V2RQOmZun0Q9kGryWqJfzush6g9Sh58wIbXn jl/pWVhtwJl4WL4IzNaOSSNnn61+wvZTKK9m918dWVS/+GSo0IKtLUPN0kLXmuQws0+Wbo3s+SRrr TbceHkO2vb27wR3zwRpbBkcckKAltm5ezxu98XKi16Px4/Zl8CoiCrLmz5JI7b4gXONs7tNCPqjqS 7CcGeNeG5kNrJvmRU8OfDBL++HgvbNM8i4L8rj4EZarJ4/L8Tpuou4tBwgSLRh2078fhEGFTjubXR sENiWtRtZXjYzGUFFafQ==; 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 1j8j9g-0008Ug-EA; Mon, 02 Mar 2020 11:22:36 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8j9R-0008FV-Vy for linux-mediatek@lists.infradead.org; Mon, 02 Mar 2020 11:22:26 +0000 Received: by mail-wr1-x444.google.com with SMTP id r7so12095811wro.2 for ; Mon, 02 Mar 2020 03:22:21 -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=TWZLnh5xO0iD8TzI5RtSCqoBdWziZichVCTr2duB2v/Bm7ubGQ1m4QkQpGX/kl4OdB RKvyf1UWKnJLag2CFG8aGN/Yg8e6qg0TjUI8QBHGX7qwI018NerySgOUV3asBFXYu9xE XoCVhXSSs6ZBPWy+TCyzY9EDGDqq/SxZBeQ86pjYOOxZYsjFBQbNqOjNqZN8w2tR7ZZN z4tkTmERIoFZ18T1raes63QD3VRHVrgCOVM2BKWKRPYqNrQyJsePHiYtLOQlIxB7KUXj DPh1rbIeBc0rH4Tl20PCbMRSed54+zYmmFJ9tnej+pfdK5/dKkrF70AnKOZWoIuhMnIW jf3A== X-Gm-Message-State: APjAAAWdkinV2bGUVrqYEiILoTUsUg+QoApWzbQfTb1a7WvsbcZedfaG 0y8n8zCDlBYpW4EhG1JmRTTojsF3AYM= X-Google-Smtp-Source: APXvYqwoftzxlJ69VQL0xqAKsfOX0Z+thgz1rFA+uNAT/dQGnLIN+PHomnMXJLjLb67L3CQ3sbGx9g== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200302_032222_079438_68290572 X-CRM114-Status: GOOD ( 12.22 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: matthias.bgg@gmail.com, ck.hu@mediatek.com, joro@8bytes.org, yong.wu@mediatek.com, Fabien Parent Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.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 Reviewed-by: Yong Wu --- 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]; }; From patchwork Mon Mar 2 11:21:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11415373 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A5F614E3 for ; Mon, 2 Mar 2020 11:22:51 +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 684BC21775 for ; Mon, 2 Mar 2020 11:22:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="k3yAt0dA"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="aXkSI2bB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 684BC21775 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.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: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rsDhswaXH3aBHjaqlLw8yJWdUa/Dgazvl3P/Rkl/eDI=; b=k3yAt0dAuzgabG miAZxu560mYGdS4+6OQK2b0zV3D3TczeesgYrhHF5gP8hVgriMMPIAByMtZmEIxpIeBoiViYxf+zh abD3YlcOnVIbF7yhDykyNsZazeQYU6UTX3NdBUsEFzorV0UyXwHAUdZfxf4tOWLWT5V94GW24I6K3 jjpn5ngv4pVfpV4yGK1eelzyESkW+VNyM+u/YOFrfPoYP+OBnpJoSeGH3VnLd7o06B/iHpmzhca92 Q2/EYwc9mR8/CZ9ckxEGbmmbsUJZ65SXpp5waUL92TvwzZG/dagpUpsMBtRjtrDy46F5zOTNHFv7U v2o6h46xCY6yCpubapGQ==; 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 1j8j9u-0000Iv-3h; Mon, 02 Mar 2020 11:22:50 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8j9X-0008IX-Ut for linux-mediatek@lists.infradead.org; Mon, 02 Mar 2020 11:22:29 +0000 Received: by mail-wm1-x343.google.com with SMTP id 6so2237290wmi.5 for ; Mon, 02 Mar 2020 03:22:27 -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=pXFVNDmvd1Q57O9A14StFD9o/pCLl1WZ1LXT9jyY7wg=; b=aXkSI2bBqKF1Vn9HUmliqysTYyVduIDV+GQticrpQgMBTuEwdyXOU/yJMasY+tU5Bh hp9mdNGiZWQRZY43djxJU5Te2hjCeYOJpZE7Kf3yMhWMtbjr/YfeBWsTUYMli0o6aneL hjQxlCGaHxw5B4mqGQuBdfFY64NBTbqKcFbD9Q9B+reFNDjYSirVv+uhEuEH2mPjEYye DHGWR6uPEVThhBh32hv4RMSCHXtXBfMxNBgCzr3MAjMAcXu9Vuz4o2qszUfTlZaWAC/q a5CF7XzPxLXyWRXiFRJ0m1biCtXgBj/ia3i8conaAv6hKKaW6UZZ1bQ38AcQvB9ihgIL o5hQ== 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=pXFVNDmvd1Q57O9A14StFD9o/pCLl1WZ1LXT9jyY7wg=; b=Iwf0nQEXFW/mbY1x7zT+W93kulqlomR9zHLuymX57PFByBpuUiMxnGgroQCGsVyAlu iAU3RijuzmzvOgKeNsx0fbq4aAzAsG/J9JXErM2gd5R4sZYor4dm5U+3oOgspfscDQfF XgnxqQz+OZislqUXwuD/KaIomh53tRZsNWgq/4CxycfRlc5EZF0CqQGVVopfjUUZkaGX onlZKTXKgKAawcbRF9sEw+mlszT4HAjT5Y5LyU3Eu2Qmkk7C1TZCuKvRzuqYnrbTF8tx Yn9DiyHIoAJO5eOJJa1TVpDO0zeH+biHkQZ+53d4nX23jibd0q6ipYCpptK9+2GM4tak cICw== X-Gm-Message-State: APjAAAXlrinUB032ayfo8R3CUx34cwDBz7+ERyORVPNblvwtUBw7vOLq GLfZPNFp9MgyMdb3Ykr8aKqtfqS3vbM= X-Google-Smtp-Source: APXvYqz+e/Cqch5x656k3Vz2SnBMUPxNp29Vb0LYw28FU3uDN1mzrpA/IdGcwPsttcC9lnuYBg3tgQ== X-Received: by 2002:a05:600c:2942:: with SMTP id n2mr18840374wmd.87.1583148143534; Mon, 02 Mar 2020 03:22:23 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 03:22:23 -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 Subject: [PATCH v2 3/3] iommu/mediatek: add support for MT8167 Date: Mon, 2 Mar 2020 12:21:52 +0100 Message-Id: <20200302112152.2887131-3-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200302_032228_002226_B4222FBD X-CRM114-Status: GOOD ( 11.38 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:343 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: matthias.bgg@gmail.com, ck.hu@mediatek.com, joro@8bytes.org, yong.wu@mediatek.com, Fabien Parent Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Add support for the IOMMU on MT8167 Signed-off-by: Fabien Parent Reviewed-by: Yong Wu --- V2: * removed if based on m4u_plat, and using instead the new has_legacy_ivrp_paddr member that was introduced in patch 2. --- drivers/iommu/mtk_iommu.c | 9 +++++++++ drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 78cb14ab7dd0..25b7ad1647ba 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -782,6 +782,14 @@ static const struct mtk_iommu_plat_data mt2712_data = { .larbid_remap = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, }; +static const struct mtk_iommu_plat_data mt8167_data = { + .m4u_plat = M4U_MT8167, + .has_4gb_mode = true, + .has_legacy_ivrp_paddr = true; + .reset_axi = true, + .larbid_remap = {0, 1, 2, 3, 4, 5}, /* Linear mapping. */ +}; + static const struct mtk_iommu_plat_data mt8173_data = { .m4u_plat = M4U_MT8173, .has_4gb_mode = true, @@ -799,6 +807,7 @@ static const struct mtk_iommu_plat_data mt8183_data = { static const struct of_device_id mtk_iommu_of_ids[] = { { .compatible = "mediatek,mt2712-m4u", .data = &mt2712_data}, + { .compatible = "mediatek,mt8167-m4u", .data = &mt8167_data}, { .compatible = "mediatek,mt8173-m4u", .data = &mt8173_data}, { .compatible = "mediatek,mt8183-m4u", .data = &mt8183_data}, {} diff --git a/drivers/iommu/mtk_iommu.h b/drivers/iommu/mtk_iommu.h index 4696ba027a71..72f874ec9e9c 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -30,6 +30,7 @@ struct mtk_iommu_suspend_reg { enum mtk_iommu_plat { M4U_MT2701, M4U_MT2712, + M4U_MT8167, M4U_MT8173, M4U_MT8183, };