Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp10645280rwd; Thu, 22 Jun 2023 02:52:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5x0x/Ls/vMbykRxcV/OmJAJx4VF1o+Khy5niGW0al2p3SCmIvwyGOhOIX6kZEi3ZEY1E94 X-Received: by 2002:a17:90a:6f43:b0:25e:fb6d:ce68 with SMTP id d61-20020a17090a6f4300b0025efb6dce68mr17361237pjk.6.1687427556990; Thu, 22 Jun 2023 02:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687427556; cv=none; d=google.com; s=arc-20160816; b=nBc/ChRGqJxbcNdOCLXlNEWH/XcsZbOV4iwQ3D14RfKvPLWAnVJKsMYFvNhQGu0ebn zGe4kip3b5IUSOqXtl6iGbX0twBQgt6uOWaJZ2tqbsFTjJ2laziMvagIXMH1LBpGbmN8 FhLPLyWf7Ke6fn/9/bXOTGwZ0xT53tRyknk5/5+Pltj+PlYSxNe4etJXyPhwZp+gUrvc mPiYKMGAD2D7p0HG/kJoV/CTnmaZGKQvbsDOMx+G9uUN56hyhVlmyeUskfmfcE/K5UWr wkMh8HfZloAOjlOOEmaoQp31/37S6v0xRmpQaugjKiyHxD7KquVNdDxNvBmTwlyf8OHS VLNQ== 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=MC+m+tcRsTeVBb4cvnpymhmPYH781xSnOA9ifYQq59Y=; b=IpiOH2GHFjGKIbBYwF8zqhI5/E0tOr+Cjsny396ckY4K2UxIb5zz+VxU5xKMoa0BY3 r2+yYwvrYyDyw/QxcxqFi1x5C/MhuSD5DM1xqkJC2pejYtl1MX+w8qqn6+TRcqOLB084 XL90sAxq+ndixXPwyuVr2aG2IXbqRzoNMBvCCd7ppzi9ra59U7FBGX6GZA3I8r5Y5ioF /R6lQXXgTJdrmfNSSUH539F+ZW8Nn0y2rs0S7yEnhZwpdAND6u9K9htbed9itdAvJw8d Flp5UVctv3Jl2lTljfrwk20+biJrh88qyMyHGC4wSdl6Y8cLF5cyo+/4HwsQQIO3ARkR mCwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="NECcTL/2"; 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=QUARANTINE sp=QUARANTINE 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 w13-20020a637b0d000000b00553ebb05d25si449880pgc.80.2023.06.22.02.52.25; Thu, 22 Jun 2023 02:52:36 -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="NECcTL/2"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232069AbjFVJe3 (ORCPT + 99 others); Thu, 22 Jun 2023 05:34:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231480AbjFVJdf (ORCPT ); Thu, 22 Jun 2023 05:33:35 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96CC22680; Thu, 22 Jun 2023 02:27:57 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (unknown [IPv6:2001:b07:2ed:14ed:c5f8:7372:f042:90a2]) (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 0FD896607073; Thu, 22 Jun 2023 10:27:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687426076; bh=n60Nnkye8r/c8jtqTXR1I8KmtkRw4j4pm889IszmYGQ=; h=From:To:Cc:Subject:Date:From; b=NECcTL/2YOvYlEw23rdS9SLXKzrwVcPE3gZzI6if3iQH0VmvoT7MMCgVIBImwEC6u p2KOpCtSWUdNX2Wk5mcRflVDktMD4NmzY4IpL0ypwFdTZUJKALvX30qUbDW24fmooH ptbd7xOW06a0BWniHhLhsk3/t86n19S4zqulXy/7I3zXM6W1e2YsvPj6mK9+sY8tEY w/e2fKUh5RWUkMFhgDlilka1Cqd0MBIrsD9xxrdqm07QUNMUWEJkbdItWq8lHD+lRS diQtcI5Jrf1DgrDpT76/fKekf3+Lq2g+G155k9VP+qfowucpNB/ZGEv9upu2rwlx8R xHdF16df94NSA== From: AngeloGioacchino Del Regno To: agross@kernel.org Cc: andersson@kernel.org, luca@z3ntu.xyz, konrad.dybcio@linaro.org, dmitry.baryshkov@linaro.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, robdclark@gmail.com, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [PATCH v5 0/6] Add support for Qualcomm's legacy IOMMU v2 Date: Thu, 22 Jun 2023 11:27:36 +0200 Message-Id: <20230622092742.74819-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.40.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 This series adds support for handling "v2" firmware's IOMMU, found on at least MSM8956 and MSM8976 (some other SoCs also need the same but I honestly don't remember which ones precisely). This is strictly required to get functional IOMMUs on these SoCs. I'm sorry for not performing a much needed schema conversion on qcom,iommu.txt, but I really didn't have time to do that :-( This series was tested on Sony Xperia X and X Compact (MSM8956): ADSP, LPASS, Venus, MSS, MDP and GPU are happy :-) Changes in v5: - Renamed "qcom,ctx-num" to "qcom,ctx-asid" as suggested by Rob Herring Changes in v4: - Rebase over next-20230619 - Rewrite qcom,iommu.txt changes to qcom,iommu.yaml - Changed reset writes to only disable CB through CB_SCTLR and reset CB_FSR and CB_FAR - Addressed misc reviewer's comments Changes in v3: - Removed useless FSRRESTORE reset and definition as pointed out in Robin Murphy's review - Fixed qcom,iommu.txt changes: squashed MSM8976 compatible string addition with msm-iommu-v2 generics addition Changes in v2: - Added back Marijn's notes (sorry man!) - Added ARM_SMMU_CB_FSRRESTORE definition - Changed context bank reset to properly set FSR and FSRRESTORE AngeloGioacchino Del Regno (6): dt-bindings: iommu: qcom,iommu: Add qcom,ctx-asid property iommu/qcom: Use the asid read from device-tree if specified iommu/qcom: Disable and reset context bank before programming iommu/qcom: Index contexts by asid number to allow asid 0 dt-bindings: iommu: qcom,iommu: Add QSMMUv2 and MSM8976 compatibles iommu/qcom: Add support for QSMMUv2 and QSMMU-500 secured contexts .../devicetree/bindings/iommu/qcom,iommu.yaml | 22 +++++-- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 62 ++++++++++++++----- 2 files changed, 64 insertions(+), 20 deletions(-) -- 2.40.1