From patchwork Mon May 30 18:03:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 12864849 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 07CE2C433F5 for ; Mon, 30 May 2022 18:05:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HGbi4V7Xh96FAsbzNqt1Ye+t9gnQZp1ie3/ZG4MFGhc=; b=spQLtOWzXiIG+V 6ouvPMVqdOMTK+jt3kbmQUYjZWJFZJelT4WfVGPdyWRBJ+RUAGkphTLWh8X0OXfqNbtDdvrDWxabh BSUldUbwVN6vQbXxBVvIM9YAADarvkrZFXvJ1JczgMA+Fwzt7cYmLjAOhB9eIkmNt/wKQ9eOz2wvo /bezoRxWCkqTM38QwdzQ+68cpGCTWguc/gI3eDUxRLtxc33jniXrJNUUxzGtc6FTl/yJQ7muOFVMN R92YXFseZ48K7ajy0/9MxeagbHz8WfbIPpKyFGjb9JRvtyvQvAag8F8yApTaa02yu2dUdYgE5yDnU Quu+avYjQVREsx/Rz3Pg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvjkf-007mUS-Ti; Mon, 30 May 2022 18:04:26 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvjkJ-007mIU-G5 for linux-arm-kernel@lists.infradead.org; Mon, 30 May 2022 18:04:04 +0000 Received: by mail-wr1-x435.google.com with SMTP id x17so6607088wrg.6 for ; Mon, 30 May 2022 11:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vmIAgX4stP7tbN1utudJdCwbmHGl9Wqirrw9D2YXhxA=; b=sj37xc3nASZ+YCXla39Pf94LuVNA1E3wbnpESKap4+mtZJkHFXPsMp7U6qzSqZUvSP Zkbt24QW2ES5ClbIchtBy19300ZLdqUNMSmmUTpB6UYympcjd01q1M0KrPM9xHbQ1Qxw GHrOPXCT+kGQ4dB/KttIVWVEUjPvL6qWZSfqcDa2MSh2XvY34u/O4j3wXJ/4xhzDGdS4 KDD0P2RkI/tv81gLON3wHXZdLn5dCEoFpv7k5Jf/+ktP9RymmXCa2CHYVACXJiwm6ZVm HPCp8Ul/ru2dIS28/dji4srbNBakB6xMGNuUeH94i8RGl8OD1U0q+N7faTgqNzcaWwdG 6aHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vmIAgX4stP7tbN1utudJdCwbmHGl9Wqirrw9D2YXhxA=; b=Pl33zhArkHe1owFbytLsWf7VonGpvwkFMv17HXotiGrvKRFF2SXcosFrs2XvzhFFEM GwKG4/iA3QZFryDx9YV6rhb/bDTSXBtcidTQ/9JbiNV7ugDg9LCoLMqmfEM1N0r/BHVn WfLQyRlnwi2YK9zsxusFqAL/1XMaPm8kHaf7K+TOdAyT3rgVQlh6qzBQarieFYCvVWsS Tu/6wev5vxvawdcT6xF6wxFF45M4bHYzbvvLIc0WMdzUA2gLaKSVqmY3J1qpxps0sdkA 4Md1QHGdu9bVj2N9Yi8Hnv529Oux+G6llw0Td+6vrMlOci+C/u2hJdf8hqNcBTA8ECjr dtdw== X-Gm-Message-State: AOAM532e+CcD7CsqF5bMyWlZi1DFjhqWPRipfz9N7tBqkwe8bFKMA860 qEKCTLGtOOdISExwPfx5EibMSw== X-Google-Smtp-Source: ABdhPJzbbLY65ueNfiMy634xwWX8GhshgQaMx9qx3BJ/rdkq+iVkOzEljqVwWPwdzKhOxGv1GHmSOg== X-Received: by 2002:a05:6000:1247:b0:210:1f6c:b1cb with SMTP id j7-20020a056000124700b002101f6cb1cbmr12912728wrx.709.1653933839926; Mon, 30 May 2022 11:03:59 -0700 (PDT) Received: from helium.lan ([88.160.162.107]) by smtp.gmail.com with ESMTPSA id 9-20020a1c0209000000b00397550b387bsm1647wmc.23.2022.05.30.11.03.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 11:03:59 -0700 (PDT) From: Fabien Parent To: Yong Wu , Joerg Roedel , Will Deacon , Matthias Brugger Cc: Fabien Parent , iommu@lists.linux-foundation.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] iommu: mtk_iommu: add support for MT8365 SoC Date: Mon, 30 May 2022 20:03:28 +0200 Message-Id: <20220530180328.845692-3-fparent@baylibre.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220530180328.845692-1-fparent@baylibre.com> References: <20220530180328.845692-1-fparent@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220530_110403_566670_9D8A3BB3 X-CRM114-Status: GOOD ( 12.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add IOMMU support for MT8365 SoC. Signed-off-by: Fabien Parent Reviewed-by: Amjad Ouled-Ameur Tested-by: Amjad Ouled-Ameur --- drivers/iommu/mtk_iommu.c | 11 +++++++++++ drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 12 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index b692347d8d56..039b8f9d5022 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -1093,6 +1093,16 @@ static const struct mtk_iommu_plat_data mt8192_data = { .port_width = 5, }; +static const struct mtk_iommu_plat_data mt8365_data = { + .m4u_plat = M4U_MT8365, + .flags = RESET_AXI, + .inv_sel_reg = REG_MMU_INV_SEL_GEN1, + .iova_region = single_domain, + .iova_region_nr = ARRAY_SIZE(single_domain), + .larbid_remap = {{0}, {1}, {2}, {3}, {4}, {5}}, /* Linear mapping. */ + .port_width = 6, +}; + static const struct of_device_id mtk_iommu_of_ids[] = { { .compatible = "mediatek,mt2712-m4u", .data = &mt2712_data}, { .compatible = "mediatek,mt6779-m4u", .data = &mt6779_data}, @@ -1100,6 +1110,7 @@ static const struct of_device_id mtk_iommu_of_ids[] = { { .compatible = "mediatek,mt8173-m4u", .data = &mt8173_data}, { .compatible = "mediatek,mt8183-m4u", .data = &mt8183_data}, { .compatible = "mediatek,mt8192-m4u", .data = &mt8192_data}, + { .compatible = "mediatek,mt8365-m4u", .data = &mt8365_data}, {} }; diff --git a/drivers/iommu/mtk_iommu.h b/drivers/iommu/mtk_iommu.h index 84cecaf6d61c..cb174fa6f2ab 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -46,6 +46,7 @@ enum mtk_iommu_plat { M4U_MT8173, M4U_MT8183, M4U_MT8192, + M4U_MT8365, }; struct mtk_iommu_iova_region;