From patchwork Fri Nov 12 13:12:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 12692400 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 063F1C433F5 for ; Fri, 12 Nov 2021 13:29:10 +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 C753B61054 for ; Fri, 12 Nov 2021 13:29:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C753B61054 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=XIqarPzx18HJGFLUAdLZH8bqUpJH56nLVM73i9N6oxc=; b=dpgZkbIanc+etZ fwuCvQDol388cjZQS4T/vARksx4WiS5EinO9uW8PFGZXaL0FqSXBAqa8xwKce1Qs9yT7iFpGdP+Fc 1EixeqqrMKKSrp2qSKufy1tKVqt9e67tEKNrwvwYhCrR8X/+sTJHBWgiBg04PphAFUsqrb1VcFyc3 5wU24NtpVOgChqCdgriK9fSOaCTu6ayWvy6H4j5jtC8XkHohcLT0p8C0CCY7b0p8mF3b0mOA8vzdF uOVsamsmLvQQtbytqNXDfhI5wM4o4NcPhjsHl6YRDLmuEh67zwApLg07a+h11BT5DnxurkPYd22fP DGEwH0r/xiXLmSt0dUFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlWZu-00AXli-Ju; Fri, 12 Nov 2021 13:26:52 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlWMJ-00AUYN-VG for linux-arm-kernel@lists.infradead.org; Fri, 12 Nov 2021 13:12:52 +0000 Received: by mail-wr1-x42e.google.com with SMTP id n29so15418011wra.11 for ; Fri, 12 Nov 2021 05:12:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8aO7ckM3T39H0Wk7qRCX4lBKkW7LKGaXRtNeMERLO4o=; b=YQZx4hWWKiRlUX2atkDBZgiUI7M29Pc44id6vdkLvcynTKuqPxAiH2VH5634MkwHRQ j7d6HQ7dN45fHo0vRoElll3808/YJ3LChSjjz2F9IMCg+sd1JS3RpW32APO6RGyaWGt6 LsqZndoWNPIRlIRLFrwvrUM4c4yWXDjq5L71LPUHA3S8RKLxcPgR4reZzYHYd9LbNhin +4AaapMS0pO/9KXG1kSqNKwDF2qGVO9A6Z+DYPQpQEw8bOTa7yopXFw3vQ4vQQ/h8cYd u9ka70fjpPg9+Zx2DDNyJLA7MPdvUysKz8UW/kq9yZdnDQOECvpQE+RJeJSWZ/Q9SCcl x+VA== 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=8aO7ckM3T39H0Wk7qRCX4lBKkW7LKGaXRtNeMERLO4o=; b=KsLCWEooXoevCJrzqMHhG59QGYGMBuNGe5g4PW4BqJrnl/FUoKq2ptBfRpb40CZ7ac jmXtiQsfDSE4nmHGqvrx2QW6HeAuN9l/k+yAAxelfRFIdSvh7btOKYjG9PUlgMPJeRH5 oCWjiFmNS7q6Wqd7P5m8bT7LPEltx9I4thitP6HCJTMxlci78vtZx/H4M7/7jp14YqPd h+UVWbAC04VryJvx5/tBVQ4DA7seseafE5bHOWCPjyWO6xdGNyfe2PEFwZUjfO6A82ct tLxTXhaUbsjFsyysS34GlDbfDWEsBDjh9wMDIWvii7JlLekfRHabPwfZgrcqYsWI9M/W 4hdw== X-Gm-Message-State: AOAM533EDCdAnmKEb+14Slk3tQw7XcWLcIrkETHGdDksQKlazLNErhcX h6ot7CVp2fE5vrXQ8g6eadQ= X-Google-Smtp-Source: ABdhPJzWKB+2yBhpypkvlSQ0JIrIzaKRKirjKeuGCrWGA7DrJFB7koTqm0yuXSFqSz1nQVL0jgF7wg== X-Received: by 2002:adf:eece:: with SMTP id a14mr18580374wrp.333.1636722766523; Fri, 12 Nov 2021 05:12:46 -0800 (PST) Received: from localhost ([193.209.96.43]) by smtp.gmail.com with ESMTPSA id a141sm1520960wme.37.2021.11.12.05.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Nov 2021 05:12:44 -0800 (PST) From: Thierry Reding To: Joerg Roedel , Will Deacon , Robin Murphy , Rob Herring Cc: Thierry Reding , Jon Hunter , iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/4] arm64: tegra: Add Tegra234 IOMMUs Date: Fri, 12 Nov 2021 14:12:31 +0100 Message-Id: <20211112131231.3683098-5-thierry.reding@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211112131231.3683098-1-thierry.reding@gmail.com> References: <20211112131231.3683098-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211112_051248_102385_999BDC2F X-CRM114-Status: GOOD ( 11.29 ) 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 From: Thierry Reding The NVIDIA Tegra234 SoC comes with one single-instance ARM SMMU used by isochronous memory clients and two dual-instance ARM SMMUs used by non- isochronous memory clients. Add the corresponding device tree nodes and hook up existing memory clients (SDHCI and BPMP). Signed-off-by: Thierry Reding --- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 426 +++++++++++++++++++++++ 1 file changed, 426 insertions(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi index 07ab9137f681..104e5fdd5f8a 100644 --- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi @@ -160,6 +160,7 @@ mmc@3460000 { interconnects = <&mc TEGRA234_MEMORY_CLIENT_SDMMCRAB &emc>, <&mc TEGRA234_MEMORY_CLIENT_SDMMCWAB &emc>; interconnect-names = "dma-mem", "write"; + iommus = <&smmu_niso1 TEGRA234_SID_SDMMC4>; nvidia,pad-autocal-pull-up-offset-hs400 = <0x00>; nvidia,pad-autocal-pull-down-offset-hs400 = <0x00>; nvidia,pad-autocal-pull-up-offset-1v8-timeout = <0x0a>; @@ -198,6 +199,148 @@ hsp_top0: hsp@3c00000 { #mbox-cells = <2>; }; + smmu_niso1: iommu@8000000 { + compatible = "nvidia,tegra234-smmu", "nvidia,smmu-500"; + reg = <0x8000000 0x1000000>, + <0x7000000 0x1000000>; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + stream-match-mask = <0x7f80>; + #global-interrupts = <2>; + #iommu-cells = <1>; + + nvidia,memory-controller = <&mc>; + status = "okay"; + }; + hsp_aon: hsp@c150000 { compatible = "nvidia,tegra234-hsp", "nvidia,tegra194-hsp"; reg = <0x0c150000 0x90000>; @@ -262,6 +405,288 @@ gic: interrupt-controller@f400000 { #interrupt-cells = <3>; interrupt-controller; }; + + smmu_iso: iommu@10000000{ + compatible = "nvidia,tegra234-smmu", "nvidia,smmu-500"; + reg = <0x10000000 0x1000000>; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + stream-match-mask = <0x7f80>; + #global-interrupts = <1>; + #iommu-cells = <1>; + + nvidia,memory-controller = <&mc>; + status = "okay"; + }; + + smmu_niso0: iommu@12000000 { + compatible = "nvidia,tegra234-smmu", "nvidia,smmu-500"; + reg = <0x12000000 0x1000000>, + <0x11000000 0x1000000>; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + stream-match-mask = <0x7f80>; + #global-interrupts = <2>; + #iommu-cells = <1>; + + nvidia,memory-controller = <&mc>; + status = "okay"; + }; }; sram@40000000 { @@ -297,6 +722,7 @@ bpmp: bpmp { <&mc TEGRA234_MEMORY_CLIENT_BPMPDMAR &emc>, <&mc TEGRA234_MEMORY_CLIENT_BPMPDMAW &emc>; interconnect-names = "read", "write", "dma-mem", "dma-write"; + iommus = <&smmu_niso1 TEGRA234_SID_BPMP>; bpmp_i2c: i2c { compatible = "nvidia,tegra186-bpmp-i2c";