Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2653388pxk; Sun, 6 Sep 2020 08:24:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzC1QLnTItTbDEOX1kBRwlGnNxp38G7+Nk7Vii5K2sTyLwoWI4podQ+zcesuTsMHR1rqZJv X-Received: by 2002:a17:906:5246:: with SMTP id y6mr16845147ejm.316.1599405851440; Sun, 06 Sep 2020 08:24:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599405851; cv=none; d=google.com; s=arc-20160816; b=k7DhcWfUrd8xPw5vW2/xVqL0Zr5HaVwo9+Bb9ZkwSbPxYTiSfuHPdTXiAXyP15TnFW 890Duz3b1zgksv8FvBnPzBkNtZsLNERzsAQCOLBplIo52veZcK6T90W+xLT000uVm351 8JlFWFvaMuMdd83+rNtzI5MUJd9qzPwA8OM6Z/DODw0pUEQaIPOirkGXGzq1X50lF4uT b1HDAIkCt6+WtYN9MVSEH2JY378esPnxFQdtZiuH2XNyHt4QoiQPGmkaHGkdsArcmFak pDqD61OjOGsmoPRzJZWGDAB9hXNWCSzfCBvY6CiOyO7NSm49l519p1ISg2U89ul5OKa2 ITAw== 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=0U6+N87TtQqeJvtsYL++VRaHV5Y/ETKSefP9o6FFabM=; b=n8t55SrRJ3v1szjv2ZKOLtJoei5V1IGf3t3QaJbRBcj9+xyq1CytR6MLo+7fCCnfrT o3OLk/PFRmOtZ43XIs5CI5F81MIbMLw6Nl2jEVV4Es1r1cX2I/zxpLnoHIKPVOtF/pZB akX5FP+OA4/Mt9ue9RVrB078liEmhE3z2u6YremWqKXYUm+ID9m+O70Uqp77xHP350nC vAVVam9asdSKARqo5XLEcgpO9+ApK2uvLUU3Z+1dgudhszjJQ2SSEfgfH6DUmQ6JUPHa A7Qja50ZymjqCpzahD+ahOgTcxJEimhEEKemtGO8+j4WiMoX7U+pqzqE4T78MzLtlxjy 1l/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=OyUETwoI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si8074430ejy.466.2020.09.06.08.23.49; Sun, 06 Sep 2020 08:24:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=OyUETwoI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728956AbgIFPUZ (ORCPT + 99 others); Sun, 6 Sep 2020 11:20:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728959AbgIFPTm (ORCPT ); Sun, 6 Sep 2020 11:19:42 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8688CC061757 for ; Sun, 6 Sep 2020 08:19:38 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id c19so10669723wmd.1 for ; Sun, 06 Sep 2020 08:19:38 -0700 (PDT) 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=0U6+N87TtQqeJvtsYL++VRaHV5Y/ETKSefP9o6FFabM=; b=OyUETwoInfdSh4ScoNMRqAZdPJ8qgNTcs/PCZtrGedtu8dWgAmrBhfDVsXTa4UBvGI 5M7Rl2ssXCVXKyL3S4lLa6uvMTPO7jGhZ1IPKbyzklrYMbOvENWb+OkSQ53y6qd2ZO4s P+B/MmJVjjCPhP5lFS1uKSUrKRV+lNEzkU0hAzXdDcG+L0i7Sj587sFJIqDIHfyW/gJR p8r0R+32AHVnG37XpelpYr+7bSLaSbsY+I8FqQ8Pl3OFewkFzCWFHeTau+MI7nGQhfH5 3uLvhvYONA8hQE5Tr9VqO6w/kiialSKWmUHD3PpghDZs/JbTzaYtNtj5VeGt7ZUdCW+E ZyoQ== 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=0U6+N87TtQqeJvtsYL++VRaHV5Y/ETKSefP9o6FFabM=; b=NqPqRwtTwPP8DAaJzpQ9jkkZIri7oySwDsgsjeMjZaWQnByiGMpYk21+s8KAWXGUxS FuLRWFovWoNQ9GBfKnOFJfEaoLHW0fu1Lh2KYpkr82s44ccSNyjywCpHVRpnzbiEnswL 9N6ep14/qmGDkSfXGBvJvf7qrvfGjaAnMGe/aWsSTNXD+Yb6nLAO4+nxPaf3uBhm/rPP /7Ljy11oK/HZ08Ktf96fCmibi8f+EX09o3sFW53Yu0FNkZL2GPF7va57i2Xn3uUIhsW4 P46+vcqbsgZgUZogrpFne0UbLEnU0Ms0zF7bv1FZ+grTkWJVVreNBbLpdr8ciGN3MLCW y0Lg== X-Gm-Message-State: AOAM53138R/GaAeq18UFVassCaDekH6A0JE86U+/XN4xkNOZzZwNywx4 fcVNh0MyhfSTac1yY6Pd+HTDzA== X-Received: by 2002:a1c:a5c8:: with SMTP id o191mr17179286wme.127.1599405577152; Sun, 06 Sep 2020 08:19:37 -0700 (PDT) Received: from localhost.localdomain (208.19.23.93.rev.sfr.net. [93.23.19.208]) by smtp.gmail.com with ESMTPSA id a15sm26420646wrn.3.2020.09.06.08.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 08:19:36 -0700 (PDT) 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 Cc: joro@8bytes.org, robh+dt@kernel.org, matthias.bgg@gmail.com, yong.wu@mediatek.com, Fabien Parent Subject: [PATCH v3 3/3] iommu/mediatek: add support for MT8167 Date: Sun, 6 Sep 2020 17:19:28 +0200 Message-Id: <20200906151928.881209-3-fparent@baylibre.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200906151928.881209-1-fparent@baylibre.com> References: <20200906151928.881209-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 support for the IOMMU on MT8167 Signed-off-by: Fabien Parent --- V3: * use LEGACY_IVRP_PADDR flag instead of using a platform data member 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 | 8 ++++++++ drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index b1f85a7e9346..6079f6a23c74 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -817,6 +817,13 @@ static const struct mtk_iommu_plat_data mt6779_data = { .larbid_remap = {{0}, {1}, {2}, {3}, {5}, {7, 8}, {10}, {9}}, }; +static const struct mtk_iommu_plat_data mt8167_data = { + .m4u_plat = M4U_MT8167, + .flags = HAS_4GB_MODE | RESET_AXI | HAS_LEGACY_IVRP_PADDR, + .inv_sel_reg = REG_MMU_INV_SEL_GEN1, + .larbid_remap = {{0}, {1}, {2}}, /* Linear mapping. */ +}; + static const struct mtk_iommu_plat_data mt8173_data = { .m4u_plat = M4U_MT8173, .flags = HAS_4GB_MODE | HAS_BCLK | RESET_AXI | @@ -835,6 +842,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,mt6779-m4u", .data = &mt6779_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 122925dbe547..df32b3e3408b 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -39,6 +39,7 @@ enum mtk_iommu_plat { M4U_MT2701, M4U_MT2712, M4U_MT6779, + M4U_MT8167, M4U_MT8173, M4U_MT8183, }; -- 2.28.0