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: 11415371 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 3B13714B7 for ; Mon, 2 Mar 2020 11:22: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 177EB21775 for ; Mon, 2 Mar 2020 11:22: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="oqAfFKSj"; 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 177EB21775 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-arm-kernel-bounces+patchwork-linux-arm=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=rjtusYrs/LWSweVcg8Jc80eENympNrgHCUyYFIqU28Q=; b=oqAfFKSjsHmqh+ bLnIl1C3IXMhl2ymzlo5mgv2bDeHvb6HdkzItbu8ABMuUoG8TCkt9/Ls7RBUNMJ/D/Ck5WPF6EWUb eqqrVe4tD+AwpVQfXZYopn+PorBfHJ0qQugifCRTe8hSRcBYgi88RMp6W6RTtEa5i67lcy0X2HeOt XrUQo8KCLI0YmTPXrASpid4iMpFlwusnUxmajllvyO6VWMQ1dUYPFx62zALxo/UC7HDQxE8E22iZ2 k02KN7ARiEJP7fk5omgB1EAN8r1e+yFF/Uheawmau+9qDN/faWoPViTy9nF1kY3aJ1NCSsOjN992+ zkUvYDKmUb3kAXzhRemA==; 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 1j8j9k-00006W-Fz; Mon, 02 Mar 2020 11:22:40 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8j9Y-0008IY-1O for linux-arm-kernel@lists.infradead.org; Mon, 02 Mar 2020 11:22:29 +0000 Received: by mail-wm1-x344.google.com with SMTP id f15so10697801wml.3 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=X/z3st0g5HyunMvaMxm3clD07uk8X6yeZQFpd6GJS8x8UwYBUgUiVKax8uR71q4EGk cFM6p3ZYL+dxwYylbnTvX+VgL90EzBhrE888rjpdy853yVy9kFb7xLbUO3MMIekjpIAk exXXqKDTi3C1okXHMVKo8P2yFcmJ9NPwMQx3Gghan/We+kwPyfIcjLireqh76I6+XLPF C6F01Rhd6UFVU/iJDdCgS2FCH/8ZO+p6S9BiCW42sqjV73ey6Y9NPMAofA7tK+rTnYuR xQdZq7QyUX0kcYYjTL/Raq6VkWaN/zkKXNaQMkPrmWgcD1yG3I7BQDJkrYU8Fjq8YPpQ uB1A== X-Gm-Message-State: APjAAAUKq58BYPm/A0FOdCKEgiojnQlt4NGguMuZXZ1Y74hS0zeU5WRq QfIABM1PfZe4lmUoWl149KKVyA== 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_099871_3A2E24FC X-CRM114-Status: GOOD ( 12.84 ) 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:344 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-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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, };