From patchwork Fri Mar 5 17:33:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 12118997 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=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 45016C433E6 for ; Fri, 5 Mar 2021 17:36:52 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 CE5AA65085 for ; Fri, 5 Mar 2021 17:36:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE5AA65085 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id: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:In-Reply-To:References:List-Owner; bh=ErPb9u0MXQCm8H3kTGBxOweRkklzCaa7wSL+XqkZlZM=; b=YQOAEqM/IW25KYEQpi2bA7LSqu Q8XrOuvX9/asytSRdYrqOz10jUELT1k27pdWMHJyb+xv0rYCVik+critMDm59egd6YTExnh6Lwuor O1HxMo3Ou+gbgnl4LlWRKNvmSq1ZZWSX9ZYCBOPyc2znvXn8q09Img8DXR5dnN/o2b0oi2ze+DTAI YS30/dQcIRIKlbBerqMuLYwnCutVHhV5yq9xEXlXWKwsgwgGnuZpSlhpCQntX4qzff8eCo5gu+B31 C46dmmn+zz8MTJli0B+1L80BAAHmIgsAWGaBuUoPFHkfA+rVCtDnZcs8tzkpgc2voNPUjTC92QtvD c5LGdBNg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lIELw-00FoTG-JU; Fri, 05 Mar 2021 17:35:05 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lIEKs-00FoFe-OC for linux-arm-kernel@desiato.infradead.org; Fri, 05 Mar 2021 17:33:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To:References; bh=+LCFcmiaYDCAudcwMO+LFpkeyNPV5MjYVoOIcxzXKqs=; b=gzlITKlRvRXEwBcPRpFLnqmhUI DeWgD7TKkCdi7SegoOC0vGTIbWzU/XhapV9FNmTXAWYTLZgZrHvRErFTUfyTO9gPlujy2HCv/N3bb F9sLMvEzED0w7GYCi6dw7orDQ+tr9KDDdDYXOhoAVNT6fpUTX407xzfjQgyp1oGpl/7ECD7Xf7ug8 NHMCUiC5mTVkXEol5HRHFToZbB6n/CjW4pFHk0TZ8vENb1C2PUGMY4WSXKwk2HmoOa4YIEhdNfJ/F FOtmoHtdVH6mo/puwSrsv13yHIcXk6J+lfa7qmmRo8LpX3G7D+yNU4EXCA9KXgMcD4Nprm3dsykPp LEm0DBdw==; Received: from foss.arm.com ([217.140.110.172]) by casper.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lIEKP-00C3Xb-Ak for linux-arm-kernel@lists.infradead.org; Fri, 05 Mar 2021 17:33:39 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9855211FB; Fri, 5 Mar 2021 09:33:23 -0800 (PST) Received: from DESKTOP-VLO843J.arm.com (unknown [10.57.48.219]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C6B293F766; Fri, 5 Mar 2021 09:33:22 -0800 (PST) From: Robin Murphy To: sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, liviu.dudau@arm.com Cc: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] arm64: dts: juno: Describe PCI dma-ranges Date: Fri, 5 Mar 2021 17:33:17 +0000 Message-Id: <720d0a9a42e33148fcac45cd39a727093a32bf32.1614965598.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210305_173332_695372_5C2F869E X-CRM114-Status: GOOD ( 11.14 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The PLDA root complex on Juno relies on an address-based lookup table to generate AXI attributes for inbound PCI transactions, and as such will not pass any transaction not matching any programmed address range. The standard firmware configuration programs 3 entries covering the GICv2m MSI doorbell and the 2 DRAM regions, so add a "dma-ranges" property to describe those usable inbound windows. Signed-off-by: Robin Murphy --- arch/arm64/boot/dts/arm/juno-base.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/arm/juno-base.dtsi b/arch/arm64/boot/dts/arm/juno-base.dtsi index f6c55877fbd9..b48a76b100b1 100644 --- a/arch/arm64/boot/dts/arm/juno-base.dtsi +++ b/arch/arm64/boot/dts/arm/juno-base.dtsi @@ -544,6 +544,10 @@ ranges = <0x01000000 0x00 0x00000000 0x00 0x5f800000 0x0 0x00800000>, <0x02000000 0x00 0x50000000 0x00 0x50000000 0x0 0x08000000>, <0x42000000 0x40 0x00000000 0x40 0x00000000 0x1 0x00000000>; + /* Standard AXI Translation entries as programmed by EDK2 */ + dma-ranges = <0x02000000 0x0 0x2c1c0000 0x0 0x2c1c0000 0x0 0x00040000>, + <0x02000000 0x0 0x80000000 0x0 0x80000000 0x0 0x80000000>, + <0x43000000 0x8 0x00000000 0x8 0x00000000 0x2 0x00000000>; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 7>; interrupt-map = <0 0 0 1 &gic 0 GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, From patchwork Fri Mar 5 17:33:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 12118995 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=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 36871C433DB for ; Fri, 5 Mar 2021 17:35:25 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 C2D1765085 for ; Fri, 5 Mar 2021 17:35:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2D1765085 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id: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=fxn5Af53/MVjQIBKQSS1Ce6O4bcsd7foRw0r4TvpX+4=; b=Zu9zzZz6AtbbtW/U2dmETGL4Kv Sq5rTHYa6InsVEFcrhNRwgtKf4csg1jOs8TOb6YVOPASe423u1W+AFTSi0FcmP0lW0PY7i1XPzisW VppTjzrL3RFKGJx7lZTXqOjQhHiJ/CSlYkm2bfNI46o5xlAE1xCnmj1AaAjxmX0WDCgFbf5l0YmBP eNzm1A0JZZYmjLbZhCnXUAVEPuNk860FTobYehoCPyLM8A8YdlJ+lAHiWWnVmqTg0ZCjs/fd49/no zBY68FTTcSOCoe6JtkJGHMtr9yv9ieuVQDfPxXdlISQuD9ZNS16WNhpraxHpAN0wf4ENL87VuXehS 8f3Vb9qg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lIEKZ-00FoDE-D6; Fri, 05 Mar 2021 17:33:39 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1234::107]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lIEKV-00FoCQ-Qv for linux-arm-kernel@lists.infradead.org; Fri, 05 Mar 2021 17:33:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=1Lc20Sa46PBCkaZk1uq1rLV1Bu3v24szo9XNrL+lkEU=; b=mTUAg5KOParzCrkTgzbTWG7tRk KDWztH90jOisfzFhwGrV6EtB+rUwBdmXlnEYSYNrXSUINKbOAexdogjfnRP7HMdvKogZHOu5BRBfJ BqRdXAHKv1VDN7Fa6f2SOwm2qVdQV5rG1D8HKBx5+rzHnkhMU8lWpnTgC/s1r7+tj46pPoYfDdzdG KbfkywbSOGwMr4msFaHXIzne0sOFe0p4WpNvbA9BZKk1u/4favE+ybwZ9PcM0uUHfgRyDntJ3IM7N QVwBI18ylG6rigLMridz3c3IkgPoReF3VkAfdUomFP5Ovm5tKVkd86z5SSDpCIMGVnyO66HV7Usp8 D7KftY+Q==; Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lIEKQ-0008Hf-EU for linux-arm-kernel@lists.infradead.org; Fri, 05 Mar 2021 17:33:34 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A77D412FC; Fri, 5 Mar 2021 09:33:24 -0800 (PST) Received: from DESKTOP-VLO843J.arm.com (unknown [10.57.48.219]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D478E3F766; Fri, 5 Mar 2021 09:33:23 -0800 (PST) From: Robin Murphy To: sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, liviu.dudau@arm.com Cc: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] arm64: dts: juno: Enable more SMMUs Date: Fri, 5 Mar 2021 17:33:18 +0000 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: <720d0a9a42e33148fcac45cd39a727093a32bf32.1614965598.git.robin.murphy@arm.com> References: <720d0a9a42e33148fcac45cd39a727093a32bf32.1614965598.git.robin.murphy@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210305_123332_036037_90D5C0F0 X-CRM114-Status: GOOD ( 13.34 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that PCI inbound window restrictions are handled generically between the of_pci resource parsing and the IOMMU layer, and described in the Juno DT, we can finally enable the PCIe SMMU without the risk of DMA mappings inadvertently allocating unusable addresses. Similarly, the relevant support for IOMMU mappings for peripheral transfers has been hooked up in the pl330 driver for ages, so we can happily enable the DMA SMMU without that breaking anything either. Signed-off-by: Robin Murphy Tested-by: Linux Kernel Functional Testing --- arch/arm64/boot/dts/arm/juno-base.dtsi | 1 - arch/arm64/boot/dts/arm/juno-r1.dts | 4 ++++ arch/arm64/boot/dts/arm/juno-r2.dts | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/arm/juno-base.dtsi b/arch/arm64/boot/dts/arm/juno-base.dtsi index b48a76b100b1..1cc7fdcec51b 100644 --- a/arch/arm64/boot/dts/arm/juno-base.dtsi +++ b/arch/arm64/boot/dts/arm/juno-base.dtsi @@ -644,7 +644,6 @@ #iommu-cells = <1>; #global-interrupts = <1>; dma-coherent; - status = "disabled"; }; smmu_hdlcd1: iommu@7fb10000 { diff --git a/arch/arm64/boot/dts/arm/juno-r1.dts b/arch/arm64/boot/dts/arm/juno-r1.dts index 5f290090b0cf..0e24e29eb9b1 100644 --- a/arch/arm64/boot/dts/arm/juno-r1.dts +++ b/arch/arm64/boot/dts/arm/juno-r1.dts @@ -230,6 +230,10 @@ status = "okay"; }; +&smmu_pcie { + status = "okay"; +}; + &etm0 { cpu = <&A57_0>; }; diff --git a/arch/arm64/boot/dts/arm/juno-r2.dts b/arch/arm64/boot/dts/arm/juno-r2.dts index 305300dd521c..e609420ce3e4 100644 --- a/arch/arm64/boot/dts/arm/juno-r2.dts +++ b/arch/arm64/boot/dts/arm/juno-r2.dts @@ -236,6 +236,10 @@ status = "okay"; }; +&smmu_pcie { + status = "okay"; +}; + &etm0 { cpu = <&A72_0>; };