From patchwork Mon Aug 26 21:50:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 13778547 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A2CADC5472C for ; Mon, 26 Aug 2024 21:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4KBzC3UYDzVcntWEjAfh9aq0jCErmi0ZBb3RSeN9zX0=; b=r7zS5FRqaVWRQsuxNgT0WyskJu fW6LmbagfD9bog5MPQGmZZ8utcXA0CeOXzjETx3mc4JI71Q06Kek5pp2g4OOeGO1Waxqyhz6syAUE NFZVmrbv7W/RYsRpzMCH+uqX2huObjY0esvt0JXl/xOsQLxmys0bpgGMbJtEGjjqTeB5bDRdruS65 wFZc5I60MmHp0ejiUEd8pPB0z5sVjBZeu3H6aC+aIr3PkRFkHrdMvLFDzPLbC0knu1gvCTKaRMOf2 n7oNJXbtW5VtTVQIg/iQR/pwQG195rRP/XsRPRLpa+ldoDw9L6OOazrcE19+o1ObPb+xxYqvy9CQw 1xfQ52GQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihfx-00000008u1Q-05hP; Mon, 26 Aug 2024 21:55:01 +0000 Received: from mta-64-228.siemens.flowmailer.net ([185.136.64.228]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihbL-00000008sw1-3fmZ for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 21:50:18 +0000 Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 2024082621501175a29e6350b53235d1 for ; Mon, 26 Aug 2024 23:50:11 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=jan.kiszka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=4KBzC3UYDzVcntWEjAfh9aq0jCErmi0ZBb3RSeN9zX0=; b=h6GzX7KFlNaUEaizddMQ1Ra0NaF8FCZZ5+TjHqio13SV6DdYo61qRs592yR47duXx5xW2v I8FJeTp6+sKqLcaARcIjQvecZ4b+FgKgzG/KchNF+HsQveb/rptwbsJdzqGFlzGLlQEvGDy2 YGyFduuPUa82CSzttK+yFLKkGJ7ScMpY3fXxs153jtDTu8y+soal0TGGjixUDCKXih4BWFhY 90vJZJSzoVRY4ANh9PwBmSNLW/c8QW9zL2RXO18noyEg8PPNK6gDmSR0iFpxTaC/DD7dLHFE xIOpyWMDw4/HMfaxZ1qlDZ1z0NX/KHGrJTpC99+tye8vbTSRafV89dHg==; From: Jan Kiszka To: Nishanth Menon , Santosh Shilimkar , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Siddharth Vadapalli , Bao Cheng Su , Hua Qian Li , Diogo Ivo Subject: [PATCH v2 6/6] arm64: dts: ti: iot2050: Enforce DMA isolation for devices behind PCI RC Date: Mon, 26 Aug 2024 23:50:07 +0200 Message-ID: <695e8ffeca42a765a35ea1e5df61a5ed16ef7180.1724709007.git.jan.kiszka@siemens.com> In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_145016_072546_C3FCF55A X-CRM114-Status: GOOD ( 10.30 ) 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: Jan Kiszka Reserve a 64M memory region below the top of 1G RAM (smallest RAM size across the series, space left for firmware carve-outs) and ensure that all PCI devices do their DMA only inside that region. This is configured via a restricted-dma-pool and enforced with the help of the first PVU. Signed-off-by: Jan Kiszka --- .../boot/dts/ti/k3-am65-iot2050-common.dtsi | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi b/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi index e76828ccf21b..cc0f33e3519c 100644 --- a/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi @@ -82,6 +82,11 @@ wdt_reset_memory_region: wdt-memory@a2200000 { reg = <0x00 0xa2200000 0x00 0x1000>; no-map; }; + + pci_restricted_dma_region: restricted-dma@ba000000 { + compatible = "restricted-dma-pool"; + reg = <0 0xba000000 0 0x4000000>; + }; }; leds { @@ -571,6 +576,10 @@ seboot-backup@e80000 { }; }; +&pcie0_rc { + memory-region = <&pci_restricted_dma_region>; +}; + &pcie1_rc { status = "okay"; pinctrl-names = "default"; @@ -580,6 +589,8 @@ &pcie1_rc { phys = <&serdes1 PHY_TYPE_PCIE 0>; phy-names = "pcie-phy0"; reset-gpios = <&wkup_gpio0 27 GPIO_ACTIVE_HIGH>; + + memory-region = <&pci_restricted_dma_region>; }; &mailbox0_cluster0 { @@ -640,3 +651,24 @@ &mcu_r5fss0 { /* lock-step mode not supported on iot2050 boards */ ti,cluster-mode = <0>; }; + +&main_navss { + ti_pvu0: ti-pvu@30f80000 { + compatible = "ti,am654-pvu"; + reg = <0 0x30f80000 0 0x1000>, + <0 0x36000000 0 0x100000>; + reg-names = "cfg", "tlbif"; + interrupts-extended = <&intr_main_navss 390>; + interrupt-names = "pvu"; + }; + + ti_pvu1: ti-pvu@30f81000 { + compatible = "ti,am654-pvu"; + reg = <0 0x30f81000 0 0x1000>, + <0 0x36100000 0 0x100000>; + reg-names = "cfg", "tlbif"; + interrupts-extended = <&intr_main_navss 389>; + interrupt-names = "pvu"; + status = "disabled"; + }; +};