From patchwork Thu Jun 3 16:46:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 12297685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B73E3C47096 for ; Thu, 3 Jun 2021 16:53:27 +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 86A41613B1 for ; Thu, 3 Jun 2021 16:53:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86A41613B1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Kp0HKiuL9jvig7FuqILK/aqL0QqeYl/nPDSk+JdYfSU=; b=TOuMsS2LYB2WFf vsLnw6iKV0bNeOIqEyZmvJal3YkUTBPPZuSPkeh5PfB6+u7cL7yck3qwRq/zUGtsFwNhCRbgjx31o AlwSHPFf7Z10cnJs7uN+hw88R3pCPFcX8dcXE1RDb4A+H8gDa5QOh7hrV2scVjrrZ00+gZd2pGhNK 5lcKxAs72WrKvkGiXOMiGmInpt3xVs3DnfM5uOY1BZLm1sc9BTnJQk4AakpszYat8Gii3md3raIw6 YLdhGXvMkonK8CeJuS+Zl0sYQSVbSk3fT7FNftpSLodL942/35zlu6yYSJp1aVDbrgYRncWaGEWec QmFoUqscII1IbXziJN+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loqYp-009dNz-IY; Thu, 03 Jun 2021 16:51:12 +0000 Received: from mail-ed1-f41.google.com ([209.85.208.41]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loqU8-009bKD-FY for linux-arm-kernel@lists.infradead.org; Thu, 03 Jun 2021 16:46:22 +0000 Received: by mail-ed1-f41.google.com with SMTP id t3so7887298edc.7 for ; Thu, 03 Jun 2021 09:46:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I2z89MxdxvGWhUJU/SEJ4QU2zKbMDk6xwIYV6O3cHbw=; b=DnVc3eGpHw8uTgSt7cOpizBr/x6zHc6dY5npOOIj0aW7DwrTYmk2iu9MlKBcq1EdPC eU/0BhqS3ZTvMzlZ1RgNaO3qIplnQhbJm4aOBmMcv8eurVhLJMDqtFUPgBR4U4m+ktyr gCu7AJq5n4UoJAGvcyVzYwNu6Y2PEAh4E9qhLNt5W5s8JyWp315B1EQMuI772Eiz/Rj0 /AeRrVNqyGQcD53ZsA8gYcFth9XW7svrwVeEQMX8GVdOyfFT8EYG1N37bLF0n3NXeDNw gf07B4BZKWQvUoRpYjcA2u5znH87BxqfDXmvykM5UAKP8OniCoSdIeWWi4eUPgNHECTQ GSWw== 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=I2z89MxdxvGWhUJU/SEJ4QU2zKbMDk6xwIYV6O3cHbw=; b=N3RAG8PHS017HyHkgZIs/p66QIQMBPWV2hmNUbRsuTS/DH4TQ6Kv2sKVpONyd+IGA2 T0vqFEVUp2zf2AzfsXwT0plSmRj4/38JRdY2XzUZKGHwyohDER+THPgJ4l/fOupFokqH 7F2OWcAvJyrFVSV5KlhnVVV0xUbIgbPzQyWrfNO38uSb85hULgINh6ktdz6bGykerpP2 sf1iFA9R1/g7zTg0uHzqQIbWp8VEu6phSTmEJzZNWkRrkDLdrSoW0OiLAwvIqJaphRZq uyVKxcJgIcEIMI4B79SWUB/udc9eJY1TSCaQbAZ9QcOSFCaFpINeWiUDQlEg/jjiEkl4 NnZQ== X-Gm-Message-State: AOAM533ps2YpwM1/zJElhXDUcHity3wvxJj9SQ0nWDbTtaJPA9TkMafi qCVG3qQR3zO1cTJAX0MBTwhi6pcJANE= X-Google-Smtp-Source: ABdhPJxnUDf8q5rYtZky60JkpGjvO01nPDdEy3yO1dQIOKvNDd/qUnT8hBVfgtEX1JIEnP/krtSlaw== X-Received: by 2002:a05:6402:416:: with SMTP id q22mr424114edv.204.1622738718619; Thu, 03 Jun 2021 09:45:18 -0700 (PDT) Received: from localhost ([62.96.65.119]) by smtp.gmail.com with ESMTPSA id y25sm1987038edt.17.2021.06.03.09.45.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 09:45:17 -0700 (PDT) From: Thierry Reding To: Thierry Reding , Will Deacon , Krzysztof Kozlowski Subject: [PATCH v3 9/9] arm64: tegra: Enable SMMU support on Tegra194 Date: Thu, 3 Jun 2021 18:46:32 +0200 Message-Id: <20210603164632.1000458-10-thierry.reding@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210603164632.1000458-1-thierry.reding@gmail.com> References: <20210603164632.1000458-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-20210603_094620_564401_638FBEB9 X-CRM114-Status: GOOD ( 11.97 ) 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: , Cc: Joerg Roedel , iommu@lists.linux-foundation.org, Jon Hunter , Nicolin Chen , linux-tegra@vger.kernel.org, Robin Murphy , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Thierry Reding Add the device tree node for the dual-SMMU found on Tegra194 and hook up peripherals such as host1x, BPMP, HDA, SDMMC, EQOS and VIC. Signed-off-by: Thierry Reding --- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 86 ++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi index ee71e0d9f895..94e1d8f1a79f 100644 --- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi @@ -62,6 +62,7 @@ ethernet@2490000 { interconnects = <&mc TEGRA194_MEMORY_CLIENT_EQOSR &emc>, <&mc TEGRA194_MEMORY_CLIENT_EQOSW &emc>; interconnect-names = "dma-mem", "write"; + iommus = <&smmu TEGRA194_SID_EQOS>; status = "disabled"; snps,write-requests = <1>; @@ -733,6 +734,7 @@ sdmmc1: mmc@3400000 { interconnects = <&mc TEGRA194_MEMORY_CLIENT_SDMMCRA &emc>, <&mc TEGRA194_MEMORY_CLIENT_SDMMCWA &emc>; interconnect-names = "dma-mem", "write"; + iommus = <&smmu TEGRA194_SID_SDMMC1>; nvidia,pad-autocal-pull-up-offset-3v3-timeout = <0x07>; nvidia,pad-autocal-pull-down-offset-3v3-timeout = @@ -759,6 +761,7 @@ sdmmc3: mmc@3440000 { interconnects = <&mc TEGRA194_MEMORY_CLIENT_SDMMCR &emc>, <&mc TEGRA194_MEMORY_CLIENT_SDMMCW &emc>; interconnect-names = "dma-mem", "write"; + iommus = <&smmu TEGRA194_SID_SDMMC3>; nvidia,pad-autocal-pull-up-offset-1v8 = <0x00>; nvidia,pad-autocal-pull-down-offset-1v8 = <0x7a>; nvidia,pad-autocal-pull-up-offset-3v3-timeout = <0x07>; @@ -790,6 +793,7 @@ sdmmc4: mmc@3460000 { interconnects = <&mc TEGRA194_MEMORY_CLIENT_SDMMCRAB &emc>, <&mc TEGRA194_MEMORY_CLIENT_SDMMCWAB &emc>; interconnect-names = "dma-mem", "write"; + iommus = <&smmu TEGRA194_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>; @@ -821,6 +825,7 @@ hda@3510000 { interconnects = <&mc TEGRA194_MEMORY_CLIENT_HDAR &emc>, <&mc TEGRA194_MEMORY_CLIENT_HDAW &emc>; interconnect-names = "dma-mem", "write"; + iommus = <&smmu TEGRA194_SID_HDA>; status = "disabled"; }; @@ -1300,6 +1305,84 @@ pmc: pmc@c360000 { interrupt-controller; }; + smmu: iommu@12000000 { + compatible = "nvidia,tegra194-smmu", "nvidia,smmu-500"; + reg = <0x12000000 0x800000>, + <0x11000000 0x800000>; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + stream-match-mask = <0x7f80>; + #global-interrupts = <2>; + #iommu-cells = <1>; + + nvidia,memory-controller = <&mc>; + status = "okay"; + }; + host1x@13e00000 { compatible = "nvidia,tegra194-host1x"; reg = <0x13e00000 0x10000>, @@ -1319,6 +1402,7 @@ host1x@13e00000 { ranges = <0x15000000 0x15000000 0x01000000>; interconnects = <&mc TEGRA194_MEMORY_CLIENT_HOST1XDMAR &emc>; interconnect-names = "dma-mem"; + iommus = <&smmu TEGRA194_SID_HOST1X>; display-hub@15200000 { compatible = "nvidia,tegra194-display"; @@ -1430,6 +1514,7 @@ vic@15340000 { interconnects = <&mc TEGRA194_MEMORY_CLIENT_VICSRD &emc>, <&mc TEGRA194_MEMORY_CLIENT_VICSWR &emc>; interconnect-names = "dma-mem", "write"; + iommus = <&smmu TEGRA194_SID_VIC>; }; dpaux0: dpaux@155c0000 { @@ -2136,6 +2221,7 @@ bpmp: bpmp { <&mc TEGRA194_MEMORY_CLIENT_BPMPDMAR &emc>, <&mc TEGRA194_MEMORY_CLIENT_BPMPDMAW &emc>; interconnect-names = "read", "write", "dma-mem", "dma-write"; + iommus = <&smmu TEGRA194_SID_BPMP>; bpmp_i2c: i2c { compatible = "nvidia,tegra186-bpmp-i2c";