From patchwork Fri Jan 3 16:26:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11317007 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 D58F6139A for ; Fri, 3 Jan 2020 16:26:48 +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 ACED522314 for ; Fri, 3 Jan 2020 16:26:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FNnnJ5V/"; 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="AVBQvJs4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACED522314 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: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=YzALpcCwwzAGWvWqccK5F3Lxb2gYgJ9Mx2Xk4U46unA=; b=FNnnJ5V/70pIn0 mDQ2Bwed314JF6FWDJ8nKenpB00g9x0/cT/UfEToS3qVuMYVMssTP7V7v2zM4daGOzB5Y3WQRwGxn +Inf9ifuB8TIqCEXtRAat6odNen7LAUaCz0gTn4lxFYLxGmAY2gfdZg7cakMIQncCaujoKc9QzP2b bgMgx1CXJ/yZwT7schRpwXo5lPLJeINVt3CjWNt8feJtAjBgvmD9P5wyM0n6kaPutfz0PZzo8JNRN +ImNhUpjGgIRHztgUgGfGR3lVP2jucbMFejs0aW+asg9JbxtPXSa/KzWh64eeznGGf1ps1pXDqCu9 sg1z061OkKDBxtukaVIw==; 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 1inPma-00066t-CB; Fri, 03 Jan 2020 16:26:40 +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 1inPmW-00065D-Lu for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2020 16:26:37 +0000 Received: by mail-wr1-x444.google.com with SMTP id d16so42936441wre.10 for ; Fri, 03 Jan 2020 08:26:36 -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=KuPXHvUieOmI5Quzb1wPB6cX8GScS9645pKcrDEMVR0=; b=AVBQvJs49csGx2cdaeh5gmzw6Urii3kTtSyLmvLNi8gpVnaPQrbqs0ZY45KCIz6EC/ C7RTEpgo77kCamXGyms333DcRTTHK0t3d+FkSC7lRW6R2yAo1bU+VYVYQrh15JxLZjFJ MuToaslvZw7Jtf2t/LLiH67L5GSUT2SzX2v4oFRtpk8hx4kmcAbZD1tjzOYwWDFbsl/U gSzTD7KiTKWxXbY5zWGhMcZhVoTHrTagHR4uj58CrjbwmtXM5qH42ph2GDpaL1aGFo2A 8zXyJlNuNISbDnnP4yeBhSHj5p0ap31ktsXFF4udaFwBhIzhi9C+ydlsrhVJuMispf9J iKCQ== 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=KuPXHvUieOmI5Quzb1wPB6cX8GScS9645pKcrDEMVR0=; b=MR340nv4hi0/EZHBecZt2lPv5PiqEm4ON4N4VpkQE1Y8Dv2cWQOlsyCJscwH7KL1LO VmSOvEVDWnvWR/WNcfHLVgXgQJi83AK8sW0xZvxwOae6bGKjZ4p3z4tj8HkrZzZaPjUs K9k8lEE58u93bsqBGuekbPoTmP/Fb9ZUwWUtRvlwZaQu4JbJt2qglao2qMFQB5WlvUUF WBerLdk+cop8x9N0gt0cQgYbEgUdX1lqkeKMKAjtcvMGKVbkT3gxYXdrz+hDe7IxiQZd 0Pyj2pXpJqZH9nH2IAri+AFIHwqbLJcBBNaUGTp8EsAmgti1y61cLpRVt9Frv3Or8Quy 03Iw== X-Gm-Message-State: APjAAAVZj1sXQDvWnq9Pztw0n3HZ9YIgT58WI45N/uk3761MvnMUcjIc gLJPxsLQeV2PllwrDRuWZXTCFw== X-Google-Smtp-Source: APXvYqywRWOLXJTVexW1vEFrIxddF8NF9xPYtArFe6KifUVJASSItqf4NTiWw0Ldz6UjN1VmdQKlBQ== X-Received: by 2002:adf:ea8a:: with SMTP id s10mr86888598wrm.278.1578068795065; Fri, 03 Jan 2020 08:26:35 -0800 (PST) Received: from radium.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id x14sm12564234wmj.42.2020.01.03.08.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 08:26:34 -0800 (PST) From: Fabien Parent To: iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 1/2] dt-bindings: iommu: Add binding for MediaTek MT8167 IOMMU Date: Fri, 3 Jan 2020 17:26:31 +0100 Message-Id: <20200103162632.109553-1-fparent@baylibre.com> X-Mailer: git-send-email 2.25.0.rc0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200103_082636_720410_AA9BEDBA X-CRM114-Status: UNSURE ( 9.14 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 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-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: mark.rutland@arm.com, matthias.bgg@gmail.com, joro@8bytes.org, robh+dt@kernel.org, Fabien Parent Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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 --- 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 Fri Jan 3 16:26:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11317011 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 E5F77139A for ; Fri, 3 Jan 2020 16:26:49 +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 C039E21734 for ; Fri, 3 Jan 2020 16:26:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MMGkY5jp"; 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="tfxrTNAl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C039E21734 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=XdpKv69yro8SI/9LzBguK3irVyqE4QyWT9c/tcm0ADs=; b=MMGkY5jpzC1+5R uoTqk3vxC92LUie6jj/cIbYSCwMmtPIkyQgeH1hWfndvO6TDKc1h34V7QzWjomSZVRSqMqWeZgxCy Vhfg0B7EzTtxbgVZP57GE1rHJBOZTcva9XdzXsk39GTwQn5VtWTuRzCIhHwg/eiGpgQ2keQJYqGht maHlLjhTEChXf/hLyREWx3vmjqXyZtc8pT4xYDgtrCm/qn+gja7s3ZNEfq7IZVEcRpQXO47O5GCpu V396V+iatfi2eK6vQx7nnktfGiichW08rno98g9k4qhYql1Xm1n4Ie0On1xJuyLInQLF8egz7BC9x hkcEaJ0V1kHhLcKLeJkg==; 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 1inPmi-0006IH-3u; Fri, 03 Jan 2020 16:26:48 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1inPmX-00065F-Gx for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2020 16:26:39 +0000 Received: by mail-wr1-x442.google.com with SMTP id j42so42907741wrj.12 for ; Fri, 03 Jan 2020 08:26:37 -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=89mFA8e7Xc7aCGnee/vBVuK6j5IjAiZj3SvE/aRAZkU=; b=tfxrTNAlbO1a4huM8IDy6tBKcl5I9hIGs22EGye9w5UqqHWTreoNTQ8QYcvb7YXmnN 35WIII5O06Ed79JL1L2aWb4w4vlKdqPa68lhyM/kYS76+BuF0TNXQ3JdF6VKtsRVcIxt namNuW/NRTfnECEKBlixtu8EePuaeEnnCl+L1sqFgUij9RjLaFDsjrGZMqb0/B5JH6p1 AwiiURZ7VLU5sgapnHFWxQ1B2ucVV3FT9uJwtXplth4sy+9CkpmwaKmoyLNSHWcsxFij MIDfBHJ+jR49lz5qMC9uZDHOTy31/xy7TXDvyNMEwMvBHQrgYoKqOPdIi02WnBU2luMd KTFA== 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=89mFA8e7Xc7aCGnee/vBVuK6j5IjAiZj3SvE/aRAZkU=; b=NJbSDD28kX/7+6zLGM0Of4F2/x3r6NZ+27I/CrmLB6d5IdDKxvdyUnPl6S+DfzCFHJ yVvP32jnEB5l6NBwdFAQeA0vgiPqGtBKWDQbkyRTFqrgccANcnZPGpcO+mPHVybcOi9z ROoGtfccdmeLNcjziecwVayBp7Eq3DNS0OQ6WWIGUf5K9eM0r1K3bx4a7Y25TteuxI2L UyfatKxWG57AEs+mdllb+e2JKOSyJIzsCKon2yHKA+WxrqMeYd0YxX2LA+PGv4vZXO6I 2vy8iCqpToR3W3lSBxGJ8FdHSNHoPZdlCeG4GZ1J1lZ9t77B2a3pIzea4oNtfbY9LCI4 Z9Dw== X-Gm-Message-State: APjAAAXZDNtPcceCQndSbUShT3S0QKGPOJM1GU1+ozoM06NKVuKNpCf/ sWxXSNS6c34PgRHGEFAbY3TSUw== X-Google-Smtp-Source: APXvYqwPg2MhuwqZ0oIndjKJulvZt5tg9dwauR6SSxBiZJ9j/GpPtJP4TrTegUABwWAZ4oYoiSU4Og== X-Received: by 2002:adf:e591:: with SMTP id l17mr82260400wrm.139.1578068796095; Fri, 03 Jan 2020 08:26:36 -0800 (PST) Received: from radium.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id x14sm12564234wmj.42.2020.01.03.08.26.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 08:26:35 -0800 (PST) From: Fabien Parent To: iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 2/2] iommu/mediatek: add support for MT8167 Date: Fri, 3 Jan 2020 17:26:32 +0100 Message-Id: <20200103162632.109553-2-fparent@baylibre.com> X-Mailer: git-send-email 2.25.0.rc0 In-Reply-To: <20200103162632.109553-1-fparent@baylibre.com> References: <20200103162632.109553-1-fparent@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200103_082637_563747_E2FF4C5D X-CRM114-Status: GOOD ( 13.27 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 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:442 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: mark.rutland@arm.com, matthias.bgg@gmail.com, joro@8bytes.org, robh+dt@kernel.org, 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 --- drivers/iommu/mtk_iommu.c | 11 ++++++++++- drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 6fc1f5ecf91e..5fc6178a82dc 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -569,7 +569,8 @@ 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->m4u_plat == M4U_MT8173 || + data->plat_data->m4u_plat == M4U_MT8167) regval = (data->protect_base >> 1) | (data->enable_4GB << 31); else regval = lower_32_bits(data->protect_base) | @@ -782,6 +783,13 @@ 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, + .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, @@ -798,6 +806,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 ea949a324e33..cb8fd5970cd4 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, };