Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1338442iog; Thu, 16 Jun 2022 04:25:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tUAgcWTbuN0fpcO/JEU/bLI3fGc3WkcX0YM5zobxk+uj1epo7vIcLg22ohxCs+PjWqGJo2 X-Received: by 2002:a62:601:0:b0:522:7a73:c0b2 with SMTP id 1-20020a620601000000b005227a73c0b2mr4471384pfg.33.1655378717669; Thu, 16 Jun 2022 04:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655378717; cv=none; d=google.com; s=arc-20160816; b=OBN/cMi8bkfAKT2/gja+D1l5fTA3qwW0WLyFAEL/IHx4BKnlSFT7fLpEJHtTAlkGQK nPhuHShkewNl5qQCDqJJi3BLa9EPDZ29f5CWUtMehhy+fyIpIz/OZ+E0IN0nXWYuF+GF tS0N3Fee2CzUTTR6Nz7ub8gfesAgFv4XIecFDqOBbFnwqxD70xyI8Qx3JZZ6I2UEIWCV MFBEA9vKYT8x4BEZv/+8W8ggvXDVc8mvB+61kQdObzb98OfZPnk9q7dZtW73l31esqYs 5U5ALVrYeABgprV64biLJZ+A1S6ePqjWT6rwO8ZB+GqO9Q8Z3uWqDnWR5kva0vgXiKHu WdfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=75CakknAqO0PMv6rE61f+6vnoUrCIgWs3bvKtyD5Cq0=; b=V7woM1VbbqXFw+p07UakiF/JsCpaj9gXuWPt8qvReFhOcxBs5spz5tcOwPsBkAgn9d YYHEessLaw6G9szentdICdluKMEb6zknpmTnw/yKHTYp7qz0+qgRIs/JWs1nvwsg2zW/ QsrWAXqwXAVR2RitREaQlXKE9bVETygWk8RuJd/2fMd/9XeKD9gw5yje7h3QPGOKwzBs 7X7aTJy9SQLqM6ivrfnxvn8xqahJ53B/XPHbS7SS48ZP+rr0oXkKZ1xOnATfJCk3Wj7b HkVe4/2TaJ7CoiGDMXNaUCCbDDUK152dwOtQy9AHXoTIsat62G06ElE3tJ86Nyqg/38J XZBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Ch6RYiKt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a17090311c400b00166449db813si2597415plh.464.2022.06.16.04.25.02; Thu, 16 Jun 2022 04:25:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Ch6RYiKt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376688AbiFPLIm (ORCPT + 99 others); Thu, 16 Jun 2022 07:08:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376633AbiFPLIl (ORCPT ); Thu, 16 Jun 2022 07:08:41 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A747B5C86F; Thu, 16 Jun 2022 04:08:40 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 686846601747; Thu, 16 Jun 2022 12:08:38 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655377719; bh=mpK1TVAIqyX6YVJK1M8Os+7jR/kqhqwVYDvOvGIs95Y=; h=From:To:Cc:Subject:Date:From; b=Ch6RYiKtPc9VsSjhrKSnp0vU0dODz448sqD29I+hfp7tCSq5/Ms2LWSEmzwV9qCFj J3HRBsegQbwFFREW/xctKgGliHrhsNAX/hzS1NR+sNIfg8fXJAyVe/5fqZ0QKL4H6w 5XeXjANUFC2PrvMdwicA55FIyaMoVZc5uBhj6yMPfuHVu2QLOLG3DQiFH1x0G5qPIF BI5vbbrHPn0UYp78uw+RtufGvAbSFKnCq94XwKZFtGPfhDMsIsH8I2XtydLwqLAW93 sEfCtPjgq0vSZdfTOF91OsyzR9Jq+0/kn8QN0ufQW/4J25FJfL/V6d3ItuimOpVXZh R7/M9tiasr5gg== From: AngeloGioacchino Del Regno To: yong.wu@mediatek.com Cc: joro@8bytes.org, will@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, matthias.bgg@gmail.com, iommu@lists.linux-foundation.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, krzysztof.kozlowski@linaro.org, miles.chen@mediatek.com, AngeloGioacchino Del Regno Subject: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg Date: Thu, 16 Jun 2022 13:08:25 +0200 Message-Id: <20220616110830.26037-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The IOMMU has registers in the infracfg and/or pericfg iospaces: as for the currently supported SoCs, MT2712 and MT8173 need a phandle to infracfg, while MT8195 needs one to pericfg. Before this change, the driver was checking for a SoC-specific infra/peri compatible but, sooner or later, these lists are going to grow a lot... ...and this is why it was chosen to add phandles (as it was done with some other drivers already - look at mtk-pm-domains, mt8192-afe Please note that, while it was necessary to update the devicetrees for MT8173 and MT2712e, there was no update for MT8195 because there is no IOMMU node in there yet. Changes in v4: - Dropped changes introducing mediatek,pericfg handle - Fixed required property in IOMMU example in patch [1/5] - Added a pericfg lookup flow cleanup commit Changes in v3: - Different squashing of dt-bindings patches (sorry for misunderstanding!) - Removed legacy devicetree print Changes in v2: - Squashed dt-bindings patches as suggested by Matthias - Removed quotes from infra/peri phandle refs - Changed dev_warn to dev_info in patches [2/7], [3/7] AngeloGioacchino Del Regno (5): dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle iommu/mediatek: Lookup phandle to retrieve syscon to infracfg arm64: dts: mediatek: mt8173: Add mediatek,infracfg phandle for IOMMU arm64: dts: mediatek: mt2712e: Add mediatek,infracfg phandle for IOMMU iommu/mediatek: Cleanup pericfg lookup flow .../bindings/iommu/mediatek,iommu.yaml | 17 +++++++ arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 2 + arch/arm64/boot/dts/mediatek/mt8173.dtsi | 1 + drivers/iommu/mtk_iommu.c | 50 +++++++++++-------- 4 files changed, 49 insertions(+), 21 deletions(-) -- 2.35.1